time_to_wait -= st;
r = pthread_mutex_trylock(mutex);
}
- if (r != 0) {
+ if ((r != 0) && (debugmessage != NULL)) {
char errstr[1000];
if (r == EBUSY)
- debug(debuglevel, "timeout at %d microseconds while waiting for a mutex: \"%s\".", dally_time,
- debugmessage);
+ debug(debuglevel,
+ "waiting for a mutex, maximum expected time of %d microseconds exceeded \"%s\".",
+ dally_time, debugmessage);
else
debug(debuglevel, "error %d: \"%s\" waiting for a mutex: \"%s\".", r,
strerror_r(r, errstr, sizeof(errstr)), debugmessage);
uint64_t time_delay = get_absolute_time_in_fp() - time_at_start;
uint64_t divisor = (uint64_t)1 << 32;
double delay = 1.0 * time_delay / divisor;
- debug(debuglevel, "debug_mutex_lock at \"%s\" -- wait time: %0.9f sec.", dstring, delay);
+ debug(debuglevel,
+ "debug_mutex_lock at \"%s\" expected max wait: %0.9f, actual wait: %0.9f sec.", dstring,
+ (1.0 * dally_time) / 1000000, delay);
}
return result;
}
debug_mutex_unlock(&conn->flush_mutex, 3);
}
- debug_mutex_lock(&conn->ab_mutex, 20000, 1);
+ debug_mutex_lock(&conn->ab_mutex, 30000, 1);
conn->packet_count++;
conn->time_of_last_audio_packet = get_absolute_time_in_fp();
if (conn->connection_state_to_output) { // if we are supposed to be processing these packets
abuf_t *curframe = 0;
int notified_buffer_empty = 0; // diagnostic only
- debug_mutex_lock(&conn->ab_mutex, 20000, 1);
+ debug_mutex_lock(&conn->ab_mutex, 30000, 1);
int wait;
long dac_delay = 0; // long because alsa returns a long
do {