Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QReadWriteLock class provides read-write locking. More...
#include <QReadWriteLock>
This class is under development and is subject to change.
The QReadWriteLock class provides read-write locking.
It is useful for synchronizing multithreaded access to resources that support multiple readers, but only one writer.
The lock is optimized for situations where there are many concurrent reads, and writing occurs infrequently. Writers are prioritized in front of readers, in the sense that readers attemting to optain the lock will yield to writers attemting to optain the lock.
This enum describes the different access types that a thread can specify when requesting the mutex.
QReadWriteLock::ReadAccess | The thread wants to perform read-operations. |
QReadWriteLock::WriteAccess | The thread wants to perform write-operations. |
Constructs a QReadWriteLock object allowing maxReaders concurrent readers. The default is INT_MAX.
See also lock().
Destroys the QReadWriteMutex object.
Warning: If you destroy a read/write mutex that has accesses in use the resultant behavior is undefined.
Attempts to lock the lock. This function will block the current thread if
See also unlock(), tryLock(), and ;.
Attempt to lock the lock. If the lock was obtained, this function returns true, otherwise it returns false instead of waiting for the lock to become available, i.e. it does not block.
The lock attempt will fail if one of the following is true:
If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it.
See also unlock(), lock(), and ;.
Unlocks the lock.
Attempting to unlock a lock that i not locked is an error and will result in program termination.
See also lock(), trylock(), and ;.
Copyright © 2004 Trolltech | Trademarks | Qt 4.0.0-b1 |