From: Mike Brady Date: Tue, 24 Mar 2020 15:57:16 +0000 (+0000) Subject: Tidy up timed mutex messages. X-Git-Tag: 3.3.7d12~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=218a4385f49b3a4cc0856bfccd28a050e86d7767;p=thirdparty%2Fshairport-sync.git Tidy up timed mutex messages. --- diff --git a/common.c b/common.c index b3942f78..2958cfe6 100644 --- a/common.c +++ b/common.c @@ -1247,9 +1247,9 @@ int sps_pthread_mutex_timedlock(pthread_mutex_t *mutex, useconds_t dally_time, char errstr[1000]; if (r == ETIMEDOUT) debug(debuglevel, - "timed out waiting for a mutex, having waiting %f seconds, with a maximum " + "timed out waiting for a mutex, having waited %f microseconds, with a maximum " "waiting time of %d microseconds. \"%s\".", - (1.0 * et) / 1000000000, dally_time, debugmessage); + (1.0E6 * et) / 1000000000, dally_time, debugmessage); else debug(debuglevel, "error %d: \"%s\" waiting for a mutex: \"%s\".", r, strerror_r(r, errstr, sizeof(errstr)), debugmessage); @@ -1309,8 +1309,8 @@ int _debug_mutex_lock(pthread_mutex_t *mutex, useconds_t dally_time, const char result = pthread_mutex_lock(mutex); uint64_t time_delay = get_absolute_time_in_ns() - time_at_start; debug(debuglevel, - "mutex_lock \"%s\" at \"%s\" expected max wait: %0.9f, actual wait: %0.9f sec.", - mutexname, dstring, (1.0 * dally_time) / 1000000, 0.000000001 * time_delay); + "mutex_lock \"%s\" at \"%s\" expected max wait: %0.9f, actual wait: %0.9f microseconds.", + mutexname, dstring, (1.0 * dally_time), 0.001 * time_delay); } pthread_setcancelstate(oldState, NULL); return result; diff --git a/common.h b/common.h index b9e9cb52..ba20078a 100644 --- a/common.h +++ b/common.h @@ -421,9 +421,6 @@ extern pthread_mutex_t r64_mutex; char *get_version_string(); // mallocs a string space -- remember to free it afterwards -void sps_nanosleep(const time_t sec, - const long nanosec); // waits for this time, even through interruptions - int64_t generate_zero_frames(char *outp, size_t number_of_frames, sps_format_t format, int with_dither, int64_t random_number_in);