QSystemReadWriteLock Class Reference
|
Operation | Condition Steps |
---|---|
Reader Progression | WAIT(Increment ReadCount) AND WAIT(WriteCount == 0) |
Reader Complete | WAIT(Decrement ReadCount) |
Writer Progression | WAIT(Increment WriteCount) |
WAIT(ReadCount == 0) | |
Writer Complete | WAIT(Decrement WriteCount) |
See also QSystemMutex.
Construct a system read write lock from the provided id. If owner is true, the instance will create the system resources required for the lock and will remove them when it is destructed.
Destroy the lock instance. If owner was specified in the QSystemReadWriteLock constructor, all the system resources used by this lock will also be removed and further use of the lock by other threads or processes will fail.
Return the id of lock as passed to the constructor.
Return true if the lock is invalid.
Attempt to acquire the read lock. This method will return true if the lock was successfully acquired, false otherwise.
Aquisition of the read lock may fail if:
The timeout milliSec, in milliseconds, expired.
If the caller wants to poll the lock in a non-blocking way, it should specify a timeout of 0. If the caller would prefer to block until the lock is acquired it should specify a timeout of -1.
Currently, only systems that support the semtimedop(2) system call can perform non-blocking, or time blocked calls. All other systems will block indefinately until the lock is acquired, regardless of the milliSec value.
The QSystemReadWriteLock instance does not refer to a valid lock.
Callers can check for an invalid lock using the isNull() method.
Attempt to acquire the write lock. This method will return true if the lock was successfully acquired, false otherwise.
Aquisition of the write lock may fail if:
The timeout milliSec, in milliseconds, expired.
If the caller wants to poll the lock in a non-blocking way, it should specify a timeout of 0. If the caller would prefer to block until the lock is acquired it should specify a timeout of -1.
Currently, only systems that support the semtimedop(2) system call can perform non-blocking, or time blocked calls. All other systems will block indefinately until the lock is acquired, regardless of the milliSec value.
The QSystemReadWriteLock instance does not refer to a valid lock.
Callers can check for an invalid lock using the isNull() method.
Release the lock.
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