void activity_monitor_stop() {
if (activity_monitor_running) {
- debug(1, "activity_monitor_stop start...");
+ debug(3, "activity_monitor_stop start...");
pthread_cancel(activity_monitor_thread);
pthread_join(activity_monitor_thread, NULL);
- debug(1, "activity_monitor_stop complete");
+ debug(2, "activity_monitor_stop complete");
}
}
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState); // make this un-cancellable
// debug(2,"audio_alsa deinit called.");
stop();
- debug(1, "Cancel buffer monitor thread.");
+ debug(2, "Cancel buffer monitor thread.");
pthread_cancel(alsa_buffer_monitor_thread);
- debug(1, "Join buffer monitor thread.");
+ debug(3, "Join buffer monitor thread.");
pthread_join(alsa_buffer_monitor_thread, NULL);
pthread_setcancelstate(oldState, NULL);
}
void dacp_monitor_stop() {
if (dacp_monitor_initialised) { // only if it's been started and initialised
- debug(1, "dacp_monitor_stop");
+ debug(2, "dacp_monitor_stop");
pthread_cancel(dacp_monitor_thread);
pthread_join(dacp_monitor_thread, NULL);
pthread_mutex_destroy(&dacp_server_information_lock);
- debug(1, "DACP Conversation Lock Mutex Destroyed");
+ debug(3, "DACP Conversation Lock Mutex Destroyed");
pthread_mutex_destroy(&dacp_conversation_lock);
}
}
}
void stop_dbus_service() {
- debug(1, "stopping dbus service");
+ debug(2, "stopping dbus service");
if (ownerID)
g_bus_unown_name(ownerID);
else
void metadata_hub_stop(void) {
if (metadata_hub_initialised) {
- debug(1, "metadata_hub_stop.");
+ debug(2, "metadata_hub_stop.");
metadata_hub_release_track_artwork();
if (metadata_store.track_metadata) {
metadata_hub_release_track_metadata(metadata_store.track_metadata);
}
void metadata_thread_cleanup_function(__attribute__((unused)) void *arg) {
- debug(1, "metadata_thread_cleanup_function called");
+ debug(2, "metadata_thread_cleanup_function called");
metadata_delete_multicast_socket();
metadata_close();
pc_queue_delete(&metadata_queue);
void metadata_stop(void) {
if (metadata_running) {
- debug(1, "metadata_stop called.");
+ debug(2, "metadata_stop called.");
pthread_cancel(metadata_thread);
pthread_join(metadata_thread, NULL);
}
__attribute__((unused)) void *baz) {}
static void sig_shutdown(__attribute__((unused)) int foo, __attribute__((unused)) siginfo_t *bar,
__attribute__((unused)) void *baz) {
- debug(1, "shutdown requested...");
+ debug(2, "shutdown requested...");
#ifdef CONFIG_LIBDAEMON
daemon_retval_send(255);
daemon_pid_file_remove();
void *dbus_thread_func(__attribute__((unused)) void *arg) {
g_main_loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(g_main_loop);
- debug(1, "g_main_loop thread exit");
+ debug(2, "g_main_loop thread exit");
pthread_exit(NULL);
}
#endif
void main_cleanup_handler(__attribute__((unused)) void *arg) {
// it doesn't look like this is called when the main function is cancelled eith a pthread cancel.
- debug(1, "main cleanup handler called.");
+ debug(2, "main cleanup handler called.");
#ifdef CONFIG_MQTT
if (config.mqtt_enabled) {
// terminate_mqtt();
stop_dbus_service();
#endif
if (g_main_loop) {
- debug(1, "Stopping DBUS Loop Thread");
+ debug(2, "Stopping DBUS Loop Thread");
g_main_loop_quit(g_main_loop);
pthread_join(dbus_thread, NULL);
}
#endif
#ifdef CONFIG_DACP_CLIENT
- debug(1, "Stopping DACP Monitor");
+ debug(2, "Stopping DACP Monitor");
dacp_monitor_stop();
#endif
#ifdef CONFIG_METADATA_HUB
- debug(1, "Stopping metadata hub");
+ debug(2, "Stopping metadata hub");
metadata_hub_stop();
#endif
activity_monitor_stop(0);
if ((config.output) && (config.output->deinit)) {
- debug(1, "Deinitialise the audio backend.");
+ debug(2, "Deinitialise the audio backend.");
config.output->deinit();
}
#ifdef CONFIG_LIBDAEMON
daemon_pid_file_remove();
daemon_signal_done();
#endif
- debug(1, "Exit...");
+ debug(2, "Exit...");
exit(0);
}
void exit_function() {
- debug(1, "exit function called...");
+ debug(2, "exit function called...");
main_cleanup_handler(NULL);
if (conns)
free(conns); // make sure the connections have been deleted first