INtime SDK Help
ntxCreateRtSemaphore(INtimeDotNet)
INtime SDK v6 > About INtime > Alternate APIs > INtimeDotNet > ntxCreateRtSemaphore(INtimeDotNet)

Creates an RT semaphore.

Visual Basic:

Function ntxCreateRtSemaphore(
  ByVal hLocation As Integer,
  ByVal wInitCount As Integer,
  ByVal wMaxCount As Integer,
  ByVal wFlags As Integer)
As Integer

Visual C#:

Int32 ntxCreateRtSemaphore (
  Int32 hLocation,
  Int32 wInitCount,
  Int32 wMaxCount,
  Int32 wFlags);

Parameters

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

Return Values

A handle for the newly-created semaphore.

INtimeException Status

E_MEM
Creating a semaphore requires more available memory to the NTX proxy than currently exists.
E_LIMIT
The 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 Reference
INtime 3.0 INtimeDotNet
See Also