![]() |
![]() |
![]() |
![]() |
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Acquire a shared lock on a pmd_attr_t structure
#include <sys/pm.h> int pmd_lock_shared(pmd_attr_t *pmd);
libpm
The pmd_lock_shared() function acquires a shared lock on the pmd_attr_t structure. Multiple threads can hold this lock and blocks any thread attempting a pmd_lock_exclusive() until all shared locks are released.
If the lock is currently held exclusively, pmd_lock_shared() blocks until the exclusive lock is 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_shared(), pmd_lock_exclusive(), pthread_lock_upgrade(), pthread_sleepon_lock(), pthread_sleepon_unlock(), pthread_sleepon_wait()
![]() |
![]() |
![]() |