Qore Programming Language Reference Manual 0.8.12.9
|constructor (RWLock rwl)|
|Creates the AutoWriteLock object based on the RWLock argument passed and immediately calls RWLock::writeLock() More...|
|Throws an exception; objects of this class cannot be copied. More...|
|Calls RWLock::writeUnlock() on the saved RWLock and destroys the AutoWriteLock object. More...|
A helper class for the RWLock class for exception-safe write lock handling.
AutoWriteLock objects, when used along with a RWLock object, allow Qore programmers to safely acquire and release a write lock, even if exceptions are thrown or return statements are executed in the block where the AutoWriteLock object is created.
AutoWriteLock objects are helper objects that acquire a write lock for the lifetime of the AutoWriteLock object. For this reason, it is only appropriate to assign an AutoWriteLock object to a local variable, so when the local variable goes out of scope, the AutoWriteLock object will be deleted and the write lock will be automatically released.
|THREAD-DEADLOCK||A deadlock was detected while trying to acquire the lock|
|LOCK-ERROR||RWLock::writeLock() called while already holding the read lock, object deleted in another thread, etc.|
Throws an exception; objects of this class cannot be copied.
|AUTOWRITELOCK-COPY-ERROR||objects of this class cannot be copied|