va_start(args, format);
vsnprintf(s, sizeof(s), format, args);
va_end(args);
+ int currentState;
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, ¤tState);
+ if (currentState == PTHREAD_CANCEL_ENABLE)
+ daemon_log(LOG_DEBUG, "Warning -- cancellation is enabled before logging");
if ((config.debugger_show_elapsed_time) && (config.debugger_show_relative_time))
daemon_log(LOG_DEBUG, "|% 20.9f|% 20.9f|%s", tss, tsl, s);
else if (config.debugger_show_relative_time)
daemon_log(LOG_DEBUG, "% 20.9f|%s", tss, s);
else
daemon_log(LOG_DEBUG, "%s", s);
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, ¤tState);
+ if (currentState == PTHREAD_CANCEL_ENABLE)
+ daemon_log(LOG_DEBUG, "Warning -- cancellation is enabled after logging");
pthread_setcancelstate(oldState,NULL);
}
int sync_error_out_of_bounds =
0; // number of times in a row that there's been a serious sync error
-// stop looking elsewhere for DACP stuff
-#ifdef CONFIG_DACP_CLIENT
- // debug(1, "Set dacp server info");
- // this does not have pthread cancellation points in it (assuming avahi doesn't)
- set_dacp_server_information(conn); // this will start scanning when a port is registered by the
- // code initiated by the mdns_dacp_monitor
-#else
- // this is only used for compatability, if dacp stuff isn't enabled.
- // start an mdns/zeroconf thread to look for DACP messages containing our DACP_ID and getting the
- // port number
- if (conn->dapo_private_storage)
- debug(1, "DACP monitor already initialised?");
- else
- // this does not have pthread cancellation points in it (assuming avahi doesn't)
- conn->dapo_private_storage = mdns_dacp_monitor(conn->dacp_id);
-#endif
-
conn->framesProcessedInThisEpoch = 0;
conn->framesGeneratedInThisEpoch = 0;
conn->correctionsRequestedInThisEpoch = 0;
pthread_cleanup_push(player_thread_cleanup_handler, arg); // undo what's been done so far
+// stop looking elsewhere for DACP stuff
+#ifdef CONFIG_DACP_CLIENT
+ // debug(1, "Set dacp server info");
+ // this does not have pthread cancellation points in it (assuming avahi doesn't)
+ set_dacp_server_information(conn); // this will start scanning when a port is registered by the
+ // code initiated by the mdns_dacp_monitor
+#else
+ // this is only used for compatability, if dacp stuff isn't enabled.
+ // start an mdns/zeroconf thread to look for DACP messages containing our DACP_ID and getting the
+ // port number
+ if (conn->dapo_private_storage)
+ debug(1, "DACP monitor already initialised?");
+ else
+ // this does not have pthread cancellation points in it (assuming avahi doesn't)
+ conn->dapo_private_storage = mdns_dacp_monitor(conn->dacp_id);
+#endif
+
// set the default volume to whaterver it was before, as stored in the config airplay_volume
debug(2, "Set initial volume to %f.", config.airplay_volume);
player_volume(config.airplay_volume, conn); // will contain a cancellation point if asked to wait