pthdb_mutex_waiter, pthdb_cond_waiter, pthdb_rwlock_read_waiter or pthdb_rwlock_write_waiter Subroutine

Purpose

Gets the next waiter in the list of an object's waiters.

Library

pthread debug library (libpthdebug.a)

Syntax

#include <sys/pthdebug.h>

int pthdb_mutex_waiter (pthdb_session_t  session,
                        pthdb_mutex_t    mutex,
                        pthdb_pthread_t * waiter,
                        int              cmd);
int  pthdb_cond_waiter (pthdb_session_t  session,
                        pthdb_cond_t     cond,
                        pthdb_pthread_t * waiter,
                        int              cmd)
int *pthdb_rwlock_read_waiter (pthdb_session_t  session,
                               pthdb_rwlock_t   rwlock,
                               pthdb_pthread_t * waiter,
                               int              cmd)
int *pthdb_rwlock_write_waiter (pthdb_session_t  session,
                                pthdb_rwlock_t   rwlock,
                                pthdb_pthread_t * waiter,
                                int              cmd)

Description

The pthdb_mutex_waiter functions get the next waiter in the list of an object's waiters.

Each list is reset to the top of the list when the pthdb_session_update function is called, or when the list function reports a PTHDB_INVALID_* value. For example, when pthdb_attr reports an attribute of PTHDB_INVALID_ATTR the list is reset to the beginning such that the next call reports the first attribute in the list, if any.

A report of PTHDB_INVALID_OBJECT represents the empty list or the end of a list, where OBJECT is one of these values: PTHREAD, ATTR, MUTEX, MUTEXATTR, COND, CONDATTR, RWLOCK, RWLOCKATTR, KEY, or TID as appropriate.

When PTHDB_LIST_FIRST is passed for the cmd parameter, the first item in the list is retrieved.

Parameters

Item Description
session Session handle.
mutex Mutex object.
cond Condition variable object.
cmd Reset to the beginning of the list.
rwlock Read/Write lock object.
waiter Pointer to waiter.

Return Values

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

Error Codes

Item Description
PTHDB_BAD_SESSION Invalid session handle.
PTHDB_BAD_CMD Invalid command.
PTHDB_CALLBACK Debugger call back error.
PTHDB_INTERNAL Error in library.
PTHDB_MEMORY Not enough memory
PTHDB_POINTER Invalid pointer