sem_write_lock


This class allows a semaphore to be auto-locked within a scope. When an os_sem_write_lock is constructed with a reference to a semaphore, it calls write_lock() on its associated semaphore. When an os_sem_write_lock is destroyed, it calls write_unlock() on its associated semaphore. An os_sem_write_lock is merely a helper class and does not own its semaphore.

Library

Thread<ToolKit>

Declaration

#include <ospace/thread/rwlock.h>

class os_sem_write_lock

Interface

Constructor
os_sem_write_lock( os_read_write_semaphore& semaphore )
Constructs a barrier that immediately acquires a write lock on semaphore , blocking if necessary.

Throws: os_thread_toolkit_error

Destructor
~os_sem_write_lock()
Releases the write lock on the associated semaphore.

Throws: os_thread_toolkit_error


Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.