Maintains internal lists of objects: pthreads, mutexes, mutex attributes, condition variables, condition variable attributes, read/write locks, read/write lock attributes, attributes, pthread specific keys, and active keys.
pthread debug library (libpthdebug.a)
#include <sys/pthdebug.h> int pthdb_pthread (pthdb_session_t session, pthdb_pthread_t *pthreadp, int cmd) int pthdb_pthread_key(pthdb_session_t session, pthread_key_t *keyp, int cmd) int pthdb_attr(pthdb_session_t session, pthdb_attr_t *attrp, int cmd) int pthdb_cond (pthdb_session_t session, pthdb_cond_t *condp, int cmd) int pthdb_condattr (pthdb_session_t session, pthdb_condattr_t *condattrp, int cmd) int pthdb_key(pthdb_session_t session, pthdb_pthread_t pthread, pthread_key_t *keyp, int cmd) int pthdb_mutex (pthdb_session_t session, pthdb_mutex_t *mutexp, int cmd) int pthdb_mutexattr (pthdb_session_t session, pthdb_mutexattr_t *mutexattrp, int cmd) int pthdb_rwlock (pthdb_session_t session, pthdb_rwlock_t *rwlockp, int cmd) int pthdb_rwlockattr (pthdb_session_t session, pthdb_rwlockattr_t *rwlockattrp, int cmd)
The pthread library maintains internal lists of objects: pthreads, mutexes, mutex attributes, condition variables, condition variable attributes, read/write locks, read/write lock attributes, attributes, pthread specific keys, and active keys. The pthread debug library provides access to these lists one element at a time via the functions listed above.
Each one of those functions acquire the next element in the list of objects. For example, the pthdb_attr function gets the next attribute on the list of attributes.
A report of PTHDB_INVALID_OBJECT represents the empty list or the end of a list, where OBJECT is equal to PTHREAD, ATTR, MUTEX, MUTEXATTR, COND, CONDATTR, RWLOCK, RWLOCKATTR, KEY, or TID as appropriate.
Each list is reset to the top of the list when the pthdb_session_update function is called, or when PTHDB_LIST_FIRST is passed for the cmd parameter, or after PTHDB_END is returned. The cmd parameter can be either PTHDB_LIST_NEXT or PTHDB_LIST_FIRST.
When PTHDB_LIST_FIRST is passed for the cmd parameter, the first item in the list is retrieved.
If successful, these functions return PTHDB_SUCCESS. Otherwise, an error code is returned.
PTHDB_BAD_SESSION | Invalid session handle. |
PTHDB_BAD_PTHREAD | Invalid pthread handle. |
PTHDB_BAD_CMD | Invalid command. |
PTHDB_BAD_POINTER | Invalid buffer pointer. |
PTHDB_INTERNAL | Error in library. |
PTHDB_MEMORY | Not enough memory |
These subroutines are part of Base Operating System (BOS) Runtime.
The pthdebug.h file.