Gets the owner's pthread, mutex's pshared value, priority ceiling, protocol, lock state, and type.
pthread debug library (libpthdebug.a)
#include <sys/pthdebug.h> int pthdb_mutex_owner (pthdb_session_t session, pthdb_mutex_t mutex, pthdb_pthread_t *ownerp) int pthdb_mutex_pshared (pthdb_session_t session, pthdb_mutex_t mutex, pthdb_pshared_t *psharedp) int pthdb_mutex_prioceiling (pthdb_session_t session, pthdb_mutex_t mutex, pthdb_pshared_t *prioceilingp) int pthdb_mutex_protocol (pthdb_session_t session, pthdb_mutex_t mutex, pthdb_pshared_t *protocolp) int pthdb_mutex_state (pthdb_session_t session, pthdb_mutex_t mutex, pthdb_mutex_state_t *statep) int pthdb_mutex_type (pthdb_session_t session, pthdb_mutex_t mutex, pthdb_mutex_type_t *typep)
pthdb_mutex_owner is used to get the pthread that owns the mutex.
The pthdb_mutex_pshared function is used to get the mutex process shared value. The pshared value can be PSH_SHARED, PSH_PRIVATE, or PSH_NOTSUP.
pthdb_mutex_prioceiling function is used to get the mutex priority ceiling value.
pthdb_mutex_protocol function is used to get the mutex protocol value. The protocol value can be MP_INHERIT, MP_PROTECT, MP_NONE, or MP_NOTSUP.
pthdb_mutex_state is used to get the value of the mutex lock state. The state can be MS_LOCKED, MS_UNLOCKED or MS_NOTSUP.
pthdb_mutex_type is used to get the value of the mutex type. The values for the mutex type can be MK_NONRECURSIVE_NP, MK_RECURSIVE_NP, MK_FAST_NP, MK_ERRORCHECK, MK_RECURSIVE, MK_NORMAL, or MK_NOTSUP.
If successful, these functions return PTHDB_SUCCESS. Otherwise, an error code is returned.
PTHDB_BAD_MUTEX | Invalid mutex handle. |
PTHDB_BAD_SESSION | Invalid session handle. |
PTHDB_CALLBACK | Debugger call back error. |
PTHDB_INTERNAL | Call failed. |
PTHDB_NOSYS | Not implemented |
PTHDB_POINTER | Invalid pointer |
These subroutines are part of the Base Operating System (BOS) Runtime.
The pthdebug.h file and the pthread.h file.