Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ td_ta_tsd_iter(3T) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

libthread_db(3T)

td_sync_get_info(3T)

td_thr_get_info(3T)

td_thr_tsd(3T)

libthread_db(4)

attributes(5)

td_ta_sync_iter(3T)

NAME

td_ta_sync_iter, td_ta_thr_iter, td_ta_tsd_iter − iterator functions on process handles from libthread_db library of interfaces

SYNOPSIS

cc [ flag ... ] file ... /lib/libthread_db.so.1 [ library ... ]

#include <proc_service.h>
#include <thread_db.h>

td_err_e td_ta_sync_iter(const td_thragent_t ∗ta_p,

td_sync_iter_f ∗cb, void ∗cbdata_p);

td_err_e td_ta_tsd_iter(const td_thragent_t ∗ta_p,

td_key_iter_f ∗cb, void ∗cbdata_p);

td_err_e td_ta_sync_iter(const td_thragent_t ∗ta_p,

td_sync_iter_f ∗cb, void ∗cbdata_p);

DESCRIPTION

td_ta_sync_iter(), td_ta_thr_iter(), and td_ta_tsd_iter() are iterator functions that when given a target process handle as an argument, return sets of handles for objects associated with the target process.  The method is to call back a client-provided function once for each associated object, passing back a handle as well as the client-provided pointer cb_data_p. This enables a client to easily build a linked list of the associated objects.

td_ta_sync_iter() returns handles of synchronization objects (mutexes, preader-writer locks, semaphores, and condition variables) associated with a process.  Some synchronization objects may not be known to libthread_db and will not be returned.  If the process has initialized the synchronization object (by calling mutex_init, for example) or a thread in the process has blocked on this object after libthread_db attached to the synchronization object, then a handle for the synchronization object will be returned by libthread_db.  See td_sync_get_info(3T) to see operations that can be performed on synchronization object handles. 

td_ta_thr_iter() returns handles for threads that are part of the target process. For td_ta_thr_iter, the caller specifies several criteria to select a subset of threads for which the callback function should be called.  Any of these selection criteria may be wild-carded. If all of them are wild-carded, then handles for all threads in the process will be returned. 

The selection parameters and corresponding wild-card values are:

state (TD_THR_ANY_STATE): Select only threads whose state matches state.  See td_thr_get_info(3T) for a list of thread states. 

ti_pri (TD_THR_LOWEST_PRIORITY):
Select only threads for which the priority is at least ti_pri. 

ti_sigmask_p (TD_SIGNO_MASK):
Select only threads whose signal mask exactly matches ∗ti_sigmask_p.

ti_user_flags (TD_THR_ANY_USER_FLAGS):
Select only threads whose user flags (specified at thread creation time) exactly match ti_user_flags.

td_ta_tsd_iter() returns the thread-specific data keys in use by the current process.  Thread-specific data for a particular thread and key may be obtained by calling td_thr_tsd(3T). 

RETURN VALUES

TD_OK The call completed successfully. 

TD_BADTA An invalid process handle was passed in. 

TD_DBERR A call to one of the imported interface routines failed. 

TD_ERR The call did not complete successfully. 

ATTRIBUTES

See attributes(5) for description of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level Safe

SEE ALSO

libthread_db(3T), td_sync_get_info(3T), td_thr_get_info(3T), td_thr_tsd(3T), libthread_db(4), attributes(5)

SunOS 5.6  —  Last change: 6 Jan 1997

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026