summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/md/windows/ntsem.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
commitf7d30133221896638f7bf4f66c504255c4b14f48 (patch)
tree5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/src/md/windows/ntsem.c
parent26b297510a11758727438df4669357a2a2bc42ce (diff)
downloadUXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/src/md/windows/ntsem.c')
-rw-r--r--nsprpub/pr/src/md/windows/ntsem.c16
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);