Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
24
Src/replicant/nx/win/nxsemaphore.c
Normal file
24
Src/replicant/nx/win/nxsemaphore.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "nxsemaphore.h"
|
||||
#include "foundation/error.h"
|
||||
int NXSemaphoreCreate(nx_semaphore_t *sem)
|
||||
{
|
||||
*sem = CreateSemaphore(0, 0, LONG_MAX, 0);
|
||||
return NErr_Success;
|
||||
}
|
||||
|
||||
int NXSemaphoreRelease(nx_semaphore_t sem)
|
||||
{
|
||||
ReleaseSemaphore(sem, 1, 0);
|
||||
return NErr_Success;
|
||||
}
|
||||
|
||||
int NXSemaphoreWait(nx_semaphore_t sem)
|
||||
{
|
||||
WaitForSingleObject(sem, INFINITE);
|
||||
return NErr_Success;
|
||||
}
|
||||
|
||||
void NXSemaphoreClose(nx_semaphore_t sem)
|
||||
{
|
||||
CloseHandle(sem);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue