[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

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_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)

Description

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

session Session handle.
mutex Mutex handle
ownerp Pointer to mutex owner
psharedp Pointer to pshared value
prioceilingp Pointer to priority ceiling value
protocolp Pointer to protocol value
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

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

Implementation Specifics

These subroutines are part of the Base Operating System (BOS) Runtime.

Related Information

The pthdebug.h file and the pthread.h file.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]