pthdb_mutex_addr, pthdb_mutex_lock_count, pthdb_mutex_owner, pthdb_mutex_pshared, pthdb_mutex_prioceiling, pthdb_mutex_protocol, pthdb_mutex_state or pthdb_mutex_type Subroutine

Purpose

Gets the owner's pthread, mutex's pshared value, priority ceiling, protocol, lock state, and type.

Library

pthread debug library (libpthdebug.a)

Syntax

#include <sys/pthdebug.h>

int pthdb_mutex_addr (pthdb_session_t  session,
                      pthdb_mutex_t    mutex,
                      pthdb_addr_t * addrp)

int pthdb_mutex_owner (pthdb_session_t  session,
                       pthdb_mutex_t    mutex,
                       pthdb_pthread_t * ownerp)

int pthdb_mutex_lock_count (pthdb_session_t  session,
                            pthdb_mutex_t    mutex,
                            int * countp);

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)

Description

pthdb_mutex_addr reports the address of the prhread_mutex_t.

pthdb_mutex_lock_count reports the lock count of the mutex.

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.

Parameters

Item Description
addr Mutex address
countp Mutex lock count
mutex Mutex handle
ownerp Pointer to mutex owner
psharedp Pointer to pshared value
prioceilingp Pointer to priority ceiling value
protocolp Pointer to protocol value
session Session handle.
statep Pointer to mutex state
typep Pointer to mutex type

Return Values

If successful, these functions return PTHDB_SUCCESS. Otherwise, an error code is returned.

Error Codes

Item Description
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