NXCondAlloc

Allocates and initializes a condition variable.

Library:LibC
Classification:NKS
Service:Synchronization

Syntax

  #include <nks/synch.h>
   
  NXCond_t  *NXCondAlloc ( 
     void  *arg);
  

Parameters

arg

(IN) Is reserved for future use. Set to NULL.

Return Values

If successful, returns a pointer to the allocated condition variable; otherwise, returns NULL.

Remarks

Condition variables can be used to support event-based synchronization where a lock or a semaphore might not be appropriate. A condition variable allocated by calling NXCondAlloc should be freed by calling NXCondFree.

NOTE:Because this function allocates and initializes, it should not be followed by a call to NXCondInit.

For sample code, see CondVar.c.

See Also