]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Tidy up timed mutex messages.
authorMike Brady <mikebradydublin@icloud.com>
Tue, 24 Mar 2020 15:57:16 +0000 (15:57 +0000)
committerMike Brady <mikebradydublin@icloud.com>
Tue, 24 Mar 2020 15:57:16 +0000 (15:57 +0000)
common.c
common.h

index b3942f78a517cc1b2a5e60b7c96e96cda10bbe6b..2958cfe614b064908f18cd3ba2deca17dbd4ee12 100644 (file)
--- 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;
index b9e9cb5218ee08390be48be05507195387612fe5..ba20078ad4a910ee680c9ee2af22f4183da8880b 100644 (file)
--- 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);