QReadWriteLock Class Reference
|
Constant | Value | Description |
---|---|---|
QReadWriteLock::Recursive | 1 | In this mode, a thread can lock the same QReadWriteLock multiple times and the mutex won't be unlocked until a corresponding number of unlock() calls have been made. |
QReadWriteLock::NonRecursive | 0 | In this mode, a thread may only lock a QReadWriteLock once. |
This enum was introduced in Qt 4.4.
See also QReadWriteLock().
Constructs a QReadWriteLock object in NonRecursive mode.
See also lockForRead() and lockForWrite().
Constructs a QReadWriteLock object in the given recursionMode.
This function was introduced in Qt 4.4.
See also lockForRead(), lockForWrite(), and RecursionMode.
Destroys the QReadWriteLock object.
Warning: Destroying a read-write lock that is in use may result in undefined behavior.
Locks the lock for reading. This function will block the current thread if any thread (including the current) has locked for writing.
See also unlock(), lockForWrite(), and tryLockForRead().
Locks the lock for writing. This function will block the current thread if another thread has locked for reading or writing.
See also unlock(), lockForRead(), and tryLockForWrite().
Attempts to lock for reading. 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 another thread has locked for writing.
If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it.
See also unlock() and lockForRead().
This is an overloaded member function, provided for convenience.
Attempts to lock for reading. This function returns true if the lock was obtained; otherwise it returns false. If another thread has locked for writing, this function will wait for at most timeout milliseconds for the lock to become available.
Note: Passing a negative number as the timeout is equivalent to calling lockForRead(), i.e. this function will wait forever until lock can be locked for reading when timeout is negative.
If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it.
See also unlock() and lockForRead().
Attempts to lock for writing. If the lock was obtained, this function returns true; otherwise, it returns false immediately.
The lock attempt will fail if another thread has locked for reading or writing.
If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it.
See also unlock() and lockForWrite().
This is an overloaded member function, provided for convenience.
Attempts to lock for writing. This function returns true if the lock was obtained; otherwise it returns false. If another thread has locked for reading or writing, this function will wait for at most timeout milliseconds for the lock to become available.
Note: Passing a negative number as the timeout is equivalent to calling lockForWrite(), i.e. this function will wait forever until lock can be locked for writing when timeout is negative.
If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it.
See also unlock() and lockForWrite().
Unlocks the lock.
Attempting to unlock a lock that is not locked is an error, and will result in program termination.
See also lockForRead(), lockForWrite(), tryLockForRead(), and tryLockForWrite().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtextended4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com