This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Acquire an exclusive lock on a pmd_attr_t structure
#include <sys/pm.h> int pmd_lock_exclusive(pmd_attr_t *pmd);
libpm
The pmd_lock_exclusive() function acquires an exclusive lock on the pmd_attr_t structure. This lock is required when calling pmd->setpower() or pmd_confirm() to protect access to the power mode status.
If the lock is already held either exclusively or shared, pmd_lock_exclusive() blocks until all locks are released.
The lock implements an "exclusive preference" so that any thread waiting for an exclusive lock prevents new shared locks being acquired if the lock is currently held shared. This allows the exclusive lock to be acquired as soon as all current shared locks are released.
For more information, see the device driver chapter.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
pmd_unlock_exclusive(), pmd_lock_downgrade(), pmd_lock_shared(), pmd_attr_setpower(), pmd_confirm(), pthread_sleepon_lock(), pthread_sleepon_unlock(), pthread_sleepon_wait()