ARGOBOTS  1227c643f7a7f974f1f1778a9ffebd29d7dafecf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
Condition Variable

Functions

int ABT_cond_create (ABT_cond *newcond)
 Create a new condition variable. More...
 
int ABT_cond_free (ABT_cond *cond)
 Free the condition variable. More...
 
int ABT_cond_wait (ABT_cond cond, ABT_mutex mutex)
 Wait on the condition. More...
 
int ABT_cond_timedwait (ABT_cond cond, ABT_mutex mutex, const struct timespec *abstime)
 Wait on the condition. More...
 
int ABT_cond_signal (ABT_cond cond)
 Signal a condition. More...
 
int ABT_cond_broadcast (ABT_cond cond)
 Broadcast a condition. More...
 

Detailed Description

This group is for Condition Variable.

Function Documentation

int ABT_cond_broadcast ( ABT_cond  cond)

Broadcast a condition.

ABT_cond_broadcast() signals all ULTs that are waiting on the condition variable. This routine shall have no effect if no ULTs are currently blocked on the condition variable.

Parameters
[in]condhandle to the condition variable
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 338 of file cond.c.

int ABT_cond_create ( ABT_cond newcond)

Create a new condition variable.

ABT_cond_create() creates a new condition variable and returns its handle through newcond. If an error occurs in this routine, a non-zero error code will be returned and newcond will be set to ABT_COND_NULL.

Parameters
[out]newcondhandle to a new condition variable
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 26 of file cond.c.

int ABT_cond_free ( ABT_cond cond)

Free the condition variable.

ABT_cond_free() deallocates the memory used for the condition variable object associated with the handle cond. If it is successfully processed, cond is set to ABT_COND_NULL.

Parameters
[in,out]condhandle to the condition variable
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 58 of file cond.c.

int ABT_cond_signal ( ABT_cond  cond)

Signal a condition.

ABT_cond_signal() signals another ULT that is waiting on the condition variable. Only one ULT is waken up by the signal and the scheduler determines the ULT. This routine shall have no effect if no ULTs are currently blocked on the condition variable.

Parameters
[in]condhandle to the condition variable
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 277 of file cond.c.

int ABT_cond_timedwait ( ABT_cond  cond,
ABT_mutex  mutex,
const struct timespec *  abstime 
)

Wait on the condition.

The ULT calling ABT_cond_timedwait() waits on the condition variable until it is signaled or the absolute time specified by abstime passes. If system time equals or exceeds abstime before cond is signaled, the error code ABT_ERR_COND_TIMEDOUT is returned.

The user should call this routine while the mutex specified as mutex is locked. The mutex will be automatically released while waiting. After signal is received and the waiting ULT is awakened, the mutex will be automatically locked for use by the ULT. The user is then responsible for unlocking mutex when the ULT is finished with it.

Parameters
[in]condhandle to the condition variable
[in]mutexhandle to the mutex
[in]abstimeabsolute time for timeout
Returns
Error code
Return values
ABT_SUCCESSon success
ABT_ERR_COND_TIMEDOUTtimeout

Definition at line 182 of file cond.c.

int ABT_cond_wait ( ABT_cond  cond,
ABT_mutex  mutex 
)

Wait on the condition.

The ULT calling ABT_cond_wait() waits on the condition variable until it is signaled. The user should call this routine while the mutex specified as mutex is locked. The mutex will be automatically released while waiting. After signal is received and the waiting ULT is awakened, the mutex will be automatically locked for use by the ULT. The user is then responsible for unlocking mutex when the ULT is finished with it.

Parameters
[in]condhandle to the condition variable
[in]mutexhandle to the mutex
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 98 of file cond.c.