1td_ta_sync_iter(3C_DB)Threads Debugging Library Functionstd_ta_sync_iter(3C_DB)
2
3
4
6 td_ta_sync_iter, td_ta_thr_iter, td_ta_tsd_iter - iterator functions on
7 process handles from libc_db
8
10 cc [ flag... ] file... -lc_db [ library... ]
11 #include <proc_service.h>
12 #include <thread_db.h>
13
14 typedef int td_sync_iter_f(const td_synchandle_t *sh_p, void *cbdata_p);
15
16
17 typedef int td_thr_iter_f(const td_thrhandle_t *th_p, void *cbdata_p);
18
19
20 typedef int td_key_iter_f(thread_key_t key, void (*destructor)(), void *cbdata_p);
21
22
23 td_err_e td_ta_sync_iter(const td_thragent_t *ta_p, td_sync_iter_f *cb,
24 void *cbdata_p);
25
26
27 td_err_e td_ta_thr_iter(const td_thragent_t *ta_p, td_thr_iter_f *cb,
28 void *cbdata_p, td_thr_state_e state, int ti_pri, sigset_t *ti_sigmask_p,
29 unsigned ti_user_flags);
30
31
32 td_err_e td_ta_tsd_iter(const td_thragent_t *ta_p, td_key_iter_f *cb,
33 void *cbdata_p);
34
35
37 The td_ta_sync_iter(), td_ta_thr_iter(), and td_ta_tsd_iter() functions
38 are iterator functions that when given a target process handle as an
39 argument, return sets of handles for objects associated with the target
40 process. The method is to call back a client-provided function once for
41 each associated object, passing back a handle as well as the client-
42 provided pointer cb_data_p. This enables a client to easily build a
43 linked list of the associated objects. If the client-provided function
44 returns non-zero, the iteration terminates, even if there are members
45 remaining in the set of associated objects.
46
47
48 The td_ta_sync_iter() function returns handles of synchronization
49 objects (mutexes, readers-writer locks, semaphores, and condition vari‐
50 ables) associated with a process. Some synchronization objects might
51 not be known to libc_db and will not be returned. If the process has
52 initialized the synchronization object (by calling mutex_init(3C), for
53 example) or a thread in the process has called a synchronization primi‐
54 tive (mutex_lock(), for example) using this object after
55 td_ta_new(3C_DB) was called to attach to the process and
56 td_ta_sync_tracking_enable() was called to enable synchronization
57 object tracking, then a handle for the synchronization object will be
58 passed to the callback function. See td_sync_get_info(3C_DB) for opera‐
59 tions that can be performed on synchronization object handles.
60
61
62 The td_ta_thr_iter() function returns handles for threads that are part
63 of the target process. For td_ta_thr_iter(), the caller specifies sev‐
64 eral criteria to select a subset of threads for which the callback
65 function should be called. Any of these selection criteria may be
66 wild-carded. If all of them are wild-carded, then handles for all
67 threads in the process will be returned.
68
69
70 The selection parameters and corresponding wild-card values are:
71
72 state (TD_THR_ANY_STATE):
73
74 Select only threads whose state matches state. See
75 td_thr_get_info(3C_DB) for a list of thread states.
76
77
78 ti_pri (TD_THR_LOWEST_PRIORITY):
79
80 Select only threads for which the priority is at least ti_pri.
81
82
83 ti_sigmask_p (TD_SIGNO_MASK):
84
85 Select only threads whose signal mask exactly matches *ti_sig‐
86 mask_p.
87
88
89 ti_user_flags (TD_THR_ANY_USER_FLAGS):
90
91 Select only threads whose user flags (specified at thread creation
92 time) exactly match ti_user_flags.
93
94
95
96 The td_ta_tsd_iter() function returns the thread-specific data keys in
97 use by the current process. Thread-specific data for a particular
98 thread and key can be obtained by calling td_thr_tsd(3C_DB).
99
101 TD_OK The call completed successfully.
102
103
104 TD_BADTA An invalid process handle was passed.
105
106
107 TD_DBERR A call to one of the imported interface routines failed.
108
109
110 TD_ERR The call did not complete successfully.
111
112
114 See attributes(5) for description of the following attributes:
115
116
117
118
119 ┌─────────────────────────────┬─────────────────────────────┐
120 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
121 ├─────────────────────────────┼─────────────────────────────┤
122 │MT-Level │Safe │
123 └─────────────────────────────┴─────────────────────────────┘
124
126 libc_db(3LIB), mutex_init(3C), td_sync_get_info(3C_DB),
127 td_thr_get_info(3C_DB), td_thr_tsd(3C_DB), attributes(5)
128
129
130
131SunOS 5.11 19 Jun 2001 td_ta_sync_iter(3C_DB)