Semaphore: Change timedWait to wait in microseconds
parent
74cd0f7da9
commit
ccbfc6ec4b
|
@ -15,7 +15,7 @@
|
|||
|
||||
-(id)init;
|
||||
-(void)signal;
|
||||
-(void)timedWait:(int)seconds;
|
||||
-(void)timedWait:(int)microseconds;
|
||||
-(void)wait;
|
||||
-(void)waitIndefinitely;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue