ward |
An os_ward is a synchronization
mechanism that allows threads to wait on a group of handles or one handle out of
the group to become posted before proceeding. A thread can wait on handles by
calling any of the three wait methods. Wards are useful in situations in which
more than one event or condition must be satisfied before proceeding.
Instances of the handle type, os_handle_t
, must be obtained using os_ward::handle_for()
static method passing a descriptor as the argument. The handle type works very
much the same as an os_event_semaphore . Handles
are tracked by the ward and are used to notify waiting threads of occurrences of
events or changes in conditions.
The compiler must be able to support multiple template partial specialization and OS_NO_PARTIAL_SPECIALIZATION must NOT be defined to use this class.
Thread<ToolKit>
#include <ospace/thread/ward.h>
class os_ward
typedef os_sentry< os_desc_t > os_handle_t;
os_handle_t
for descriptor .false
, otherwise waits until all handles become posted and returns 0
.0
immediately.Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.