globus_cond(3) | globus_common | globus_cond(3) |
globus_cond - Condition Variables.
union globus_cond_t
Condition variable. union globus_condattr_t
Condition variable attribute.
int globus_cond_init (globus_cond_t *cond,
globus_condattr_t *attr)
Initialize a condition variable
The globus_cond_init() function creates a condition
variable that can be used for event signalling between threads. " int
globus_cond_destroy (globus_cond_t *cond)
Destroy a condition variable. int globus_cond_wait
(globus_cond_t *cond, globus_mutex_t *mutex)
Wait for a condition to be signalled. int globus_cond_timedwait
(globus_cond_t *cond, globus_mutex_t *mutex, globus_abstime_t
*abstime)
Wait for a condition to be signalled. int globus_cond_signal
(globus_cond_t *cond)
Signal a condition to a thread. int globus_cond_broadcast
(globus_cond_t *cond)
Signal a condition to multiple threads. int globus_condattr_init
(globus_condattr_t *cond_attr)
Initialize a condition variable attribute. int globus_condattr_destroy
(globus_condattr_t *cond_attr)
Destroy a condition attribute. int globus_condattr_setspace
(globus_condattr_t *cond_attr, int space)
Set callback space associated with a condition variable attribute
The globus_condattr_setspace() function sets the callback
space to use with condition variables created with this attribute. Callback
spaces are used to control how callbacks are issued to different threads.
See Callback Spaces for more information on callback spaces. "
int globus_condattr_getspace (globus_condattr_t *cond_attr,
int *space)
Get callback space associated with a condition variable attribute
The globus_condattr_getspace() function copies the value of
the callback space associated with a condition variable attribute to the
integer pointed to by the space parameter. "
Condition Variables.
The globus_cond_t provides condition variables for signalling events between threads interested in particular state. One or many threads may wait on a condition variable until it is signalled, at which point they can attempt to lock a mutex related to that condition's state and process the event.
In a non-threaded model, the condition variable wait operations are used to poll the event driver to handle any operations that have been scheduled for execution by the globus_callback system or I/O system. In this way, applications written to use those systems to handle nonblocking operations will work with either a threaded or nonthreaded runtime choice.
Signal a condition to multiple threads. The globus_cond_signal() function signals a condition as occurring. This will unblock all threads waiting for that condition.
Parameters:
Returns:
Destroy a condition variable. The globus_cond_destroy() function destroys the condition variable pointed to by its cond parameter. After a condition variable is destroyed it may no longer be used unless it is again initialized by globus_cond_init().
Parameters:
Returns:
Initialize a condition variable
The globus_cond_init() function creates a condition variable that can be used for event signalling between threads.
Parameters:
Returns:
Signal a condition to a thread. The globus_cond_signal() function signals a condition as occurring. This will unblock at least one thread waiting for that condition.
Parameters:
Returns:
Wait for a condition to be signalled. The globus_cond_timedwait() function atomically unlocks the mutex pointed to by the mutex parameter and blocks the current thread until either the condition variable pointed to by cond is signalled by another thread or the current time exceeds the value pointed to by the abstime parameter. If the timeout occurs before the condition is signalled, globus_cond_timedwait() returns ETIMEDOUT. Behavior is undefined if globus_cond_timedwait() is called with the mutex pointed to by the mutex variable unlocked.
Parameters:
Returns:
Wait for a condition to be signalled. The globus_cond_wait() function atomically unlocks the mutex pointed to by the mutex parameter and blocks the current thread until the condition variable pointed to by cond is signalled by either globus_cond_signal() or globus_cond_broadcast(). Behavior is undefined if globus_cond_wait() is called with the mutex pointed to by the mutex variable unlocked.
Parameters:
Returns:
Destroy a condition attribute. The globus_condattr_destroy() function destroys the condition variable attribute structure pointed to by its cond_attr parameter.
Parameters:
Returns:
Get callback space associated with a condition variable attribute
The globus_condattr_getspace() function copies the value of the callback space associated with a condition variable attribute to the integer pointed to by the space parameter.
Parameters:
Returns:
Initialize a condition variable attribute. The globus_condattr_init() function initializes the condition variable attribute structure pointed to by its cond_attr parameter to the system default values.
Parameters:
Returns:
Set callback space associated with a condition variable attribute
The globus_condattr_setspace() function sets the callback space to use with condition variables created with this attribute. Callback spaces are used to control how callbacks are issued to different threads. See Callback Spaces for more information on callback spaces.
Parameters:
Returns:
Generated automatically by Doxygen for globus_common from the source code.
Wed Feb 27 2019 | Version 18.2 |