monitor |
An os_monitor
is a template class that is derived from os_read_write_semaphore
. When an os_monitor is constructed, it is
associated with the object to be locked. Threads that wish to lock and access
this object must adopt a cooperative scheme in which read_lock()
is used to request a read lock, write_lock() is
used to request a write lock, and operator* and operator->
are used to access the monitor's associated object. The functions read_unlock()
and write_unlock() should be used to unlock the
monitor when access to its associated object is no longer required.
#include <ospace/thread/monitor.h>
template< class T >
class os_monitor : public os_read_write_semaphore
Throws: os_thread_toolkit_error
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.