diff options
Diffstat (limited to 'nsprpub/pr/src/md/windows/ntsem.c')
-rw-r--r-- | nsprpub/pr/src/md/windows/ntsem.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/nsprpub/pr/src/md/windows/ntsem.c b/nsprpub/pr/src/md/windows/ntsem.c index f36a145a9..757bc839e 100644 --- a/nsprpub/pr/src/md/windows/ntsem.c +++ b/nsprpub/pr/src/md/windows/ntsem.c @@ -12,38 +12,40 @@ #include "primpl.h" -void +void _PR_MD_NEW_SEM(_MDSemaphore *md, PRUintn value) { md->sem = CreateSemaphore(NULL, value, 0x7fffffff, NULL); } -void +void _PR_MD_DESTROY_SEM(_MDSemaphore *md) { CloseHandle(md->sem); } -PRStatus +PRStatus _PR_MD_TIMED_WAIT_SEM(_MDSemaphore *md, PRIntervalTime ticks) { int rv; rv = WaitForSingleObject(md->sem, PR_IntervalToMilliseconds(ticks)); - if (rv == WAIT_OBJECT_0) + if (rv == WAIT_OBJECT_0) { return PR_SUCCESS; - else + } + else { return PR_FAILURE; + } } -PRStatus +PRStatus _PR_MD_WAIT_SEM(_MDSemaphore *md) { return _PR_MD_TIMED_WAIT_SEM(md, PR_INTERVAL_NO_TIMEOUT); } -void +void _PR_MD_POST_SEM(_MDSemaphore *md) { ReleaseSemaphore(md->sem, 1, NULL); |