NWOpenSemaphore
Creates and initializes a named semaphore to the indicated value
#include <nwsync.h> or #include <nwcalls.h> N_EXTERN_LIBRARY(NWCCODE)NWOpenSemaphore ( NWCONN_HANDLE conn, const nstr8 N_FAR *semName, nint16 initSemHandle, pnuint32 semHandle, pnuint16 semOpenCount);
uses calwin32 Function NWOpenSemaphore (conn : NWCONN_HANDLE; const semName : pnstr8; initSemHandle : nint16; semHandle : pnuint32; semOpenCount : pnuint16 ) : NWCCODE;
These are common return values; see Return Values (NDK: Connection, Message, and NCP Extensions) for more information.
Calling NWOpenSemaphore increments the semOpenCount counter. If the semaphore exists, initSemHandle is ignored. The handle returned must be used to access the semaphore. Only the first application to open the semaphore (and thus create the semaphore) can set the initial value in initSemHandle.
NWOpenSemaphore is usually called by setting initSemHandle to a value other than 0. If initSemHandle is set to 0, consider the following items:
NWWaitOnSemaphore decrements the semaphore value by 1 if it is greater than 0. If the semaphore value and the timeOutValue parameter are both 0, a time out failure (LOCK_ERROR) will be returned.
NWSignalSemaphore increments the semaphore value by 1.