From ccbfc6ec4b80c072b0adec28f9d62bbe42d50a9d Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 14 Jan 2022 22:43:46 -0800 Subject: [PATCH] Semaphore: Change timedWait to wait in microseconds --- Audio/Utils/Semaphore.h | 2 +- Audio/Utils/Semaphore.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Audio/Utils/Semaphore.h b/Audio/Utils/Semaphore.h index 39f98d16a..6aaece9f7 100644 --- a/Audio/Utils/Semaphore.h +++ b/Audio/Utils/Semaphore.h @@ -15,7 +15,7 @@ -(id)init; -(void)signal; --(void)timedWait:(int)seconds; +-(void)timedWait:(int)microseconds; -(void)wait; -(void)waitIndefinitely; diff --git a/Audio/Utils/Semaphore.m b/Audio/Utils/Semaphore.m index 620ff50da..af13e9d7e 100644 --- a/Audio/Utils/Semaphore.m +++ b/Audio/Utils/Semaphore.m @@ -27,9 +27,9 @@ semaphore_signal_all(semaphore); } --(void)timedWait:(int)seconds +-(void)timedWait:(int)microseconds { - mach_timespec_t timeout = {seconds, 0}; + mach_timespec_t timeout = {0, microseconds * 1000UL}; semaphore_timedwait(semaphore, timeout); }