diff options
author | rpj <rpj> | 2004-10-19 13:24:40 +0000 |
---|---|---|
committer | rpj <rpj> | 2004-10-19 13:24:40 +0000 |
commit | 8c8bcc5d1737002a9d153105c16b262d2e201efa (patch) | |
tree | ba43c6049cc7e361a3eb875015aeb4032c01c559 /sem_wait.c | |
parent | 45b1b8cb2a6588f9316f780d8cefe11c181a9a17 (diff) |
Semaphore speedups - alpha, but passes testsuite
Diffstat (limited to 'sem_wait.c')
-rw-r--r-- | sem_wait.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -92,8 +92,14 @@ sem_wait (sem_t * sem) #else /* NEED_SEM */ - result = pthreadCancelableWait ((*sem)->sem); - + sem_t s = *sem; + + if (InterlockedDecrement((LPLONG) &s->value) < 0) + { + /* Must wait */ + result = pthreadCancelableWait (s->sem); + } + #endif /* NEED_SEM */ } |