CoreDX DDS C Reference Manual
Related Functions | List of all members

A DDS_WaitSet maintains a set of DDS_Condition objects and allows the application to wait until one or more of them have a trigger_value of TRUE. More...

Related Functions

(Note that these are not member functions.)

DDS_WaitSet DDS_WaitSet__alloc (void)
 Convenience routine to allocate a DDS_WaitSet. More...
 
void DDS_WaitSet__free (DDS_WaitSet ws)
 Routine to destroy a DDS_WaitSet. More...
 
DDS_ReturnCode_t DDS_WaitSet_wait (DDS_WaitSet ws, DDS_ConditionSeq *active_conditions, DDS_Duration_t *timeout)
 Causes the controlling thread to block until an attached condition is triggered or timeout elapses. More...
 
DDS_ReturnCode_t DDS_WaitSet_attach_condition (DDS_WaitSet ws, DDS_Condition c)
 Adds the condition c to the WaitSet ws. More...
 
DDS_ReturnCode_t DDS_WaitSet_detach_condition (DDS_WaitSet ws, DDS_Condition c)
 Removes a condition c from WaitSet ws. More...
 
DDS_ReturnCode_t DDS_WaitSet_get_conditions (DDS_WaitSet ws, DDS_ConditionSeq *attached_conditions)
 Retrieves the current list of attached conditions. More...
 

Detailed Description

A DDS_WaitSet maintains a set of DDS_Condition objects and allows the application to wait until one or more of them have a trigger_value of TRUE.

Multiple conditions may be attached to a WaitSet. A WaitSet is created by a call to DDS_WaitSet__alloc(), and destroyed with a call to DDS_WaitSet__free().

Friends And Related Function Documentation

DDS_WaitSet DDS_WaitSet__alloc ( void  )
related

Convenience routine to allocate a DDS_WaitSet.

Allocates memory which should be returned via DDS_WaitSet__free().

void DDS_WaitSet__free ( DDS_WaitSet  ws)
related

Routine to destroy a DDS_WaitSet.

Releases memory which was previously allocated by DDS_WaitSet__alloc().

Note
The application should call DDS_WaitSet_detach_condition() for each attached Condition prior to calling DDS_WaitSet__free(). [This routine will not destroy any attached Conditions.]
DDS_ReturnCode_t DDS_WaitSet_attach_condition ( DDS_WaitSet  ws,
DDS_Condition  c 
)
related

Adds the condition c to the WaitSet ws.

If another thread is currently 'waiting' on the WaitSet, this newly added condition will unblock that thread if its trigger_value is TRUE.

DDS_ReturnCode_t DDS_WaitSet_detach_condition ( DDS_WaitSet  ws,
DDS_Condition  c 
)
related

Removes a condition c from WaitSet ws.

If the condition is not attached to the WaitSet, the error DDS_RETCODE_PRECONDITION_NOT_MET will be returned.

DDS_ReturnCode_t DDS_WaitSet_get_conditions ( DDS_WaitSet  ws,
DDS_ConditionSeq *  attached_conditions 
)
related

Retrieves the current list of attached conditions.

Populates the attached_conditions sequence. The application is responsible for freeing the memory contained in the sequence.

DDS_ReturnCode_t DDS_WaitSet_wait ( DDS_WaitSet  ws,
DDS_ConditionSeq *  active_conditions,
DDS_Duration_t timeout 
)
related

Causes the controlling thread to block until an attached condition is triggered or timeout elapses.

A return value of DDS_RETCODE_OK indicates that one or more of the attached conditions evaluated to TRUE. Those 'active' conditions are included in the 'out' parameter active_conditions.

A return value of DDS_RETCODE_TIMEOUT indicates that the timeout period elapsed without any of the conditions evaluating to TRUE.

Note
The application is responsible for clearing the memory contained in active_conditions upon return.

© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.