INtime SDK Help
ntxCreateRtSemaphore
INtime SDK v7.1 > About INtime > INtime Kernel > Semaphores > ntxCreateRtSemaphore

Creates an RT semaphore.

NTXHANDLE ntxCreateRtSemaphore( 
    NTXLOCATION hLocation,
    WORD wInitCount,
    WORD wMaxCount,
    WORD wFlags
);

Parameters

hLocation
The location handle of the RT client on which to create the semaphore.
wInitCount
The initial number of units to be in the custody of the new semaphore.
wMaxCount
The maximum number of units over which the new semaphore is to have custody at any given time.
wFlags
Specifies flags that control the creation of the semaphore. Possible values are described below.
NTX_FIFO_QUEUING Specifies that threads are queued on a First-In-First-Out basis. This value is mutually exclusive with the NTX_PRIORITY_QUEUING value.
NTX_PRIORITY_QUEUING Specifies that the threads waiting on this object will be queued on a priority basis.

Return Values

A handle for the newly-created semaphore.
Success.
NTX_BAD_NTXHANDLE
Failure. To determine the status, call ntxGetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_MEM
Creating a semaphore requires more available memory to the NTX proxy than currently exists.
E_LIMIT
xThe NTX proxy reached its object limit.
E_SLOT
You cannot create more RT objects because the GDT's slots are full.
E_PARAM
One or more of the following conditions exist:
  • wInitCount contains a value larger that wMaxCount
  • wMaxCount contains the value 0 (zero).

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/nt/include/ntx.h ntx.h ntxext.lib
INtime 4.01 (for 64-bit Windows) intime/nt/include/ntx.h ntx.h ntxext64.lib

See Also

Semaphore system calls