Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c_db/td_sync_get_info.3c_db
Real path: /usr/share/man/man3c_db/td_sync_get_info.3c_db
Zurück
'\" te .\" Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. .TH td_sync_get_info 3C_DB "5 Jun 2007" "Oracle Solaris 11.4" "Threads Debugging Library Functions" .SH NAME td_sync_get_info, td_ta_sync_tracking_enable, td_sync_get_stats, td_sync_setstate, td_sync_waiters \- operations on a synchronization object in libc_db .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... -lc_db [ \fIlibrary\fR... ] #include <proc_service.h> #include <thread_db.h> \fBtd_err_e\fR \fBtd_sync_get_info\fR(\fBconst td_synchandle_t *\fR\fIsh_p\fR, \fBtd_syncinfo_t *\fR\fIsi_p\fR); .fi .LP .nf \fBtd_err_e\fR \fBtd_ta_sync_tracking_enable\fR(\fBconst td_thragent_t *\fR\fIta_p\fR, \fBint\fR \fIon_off\fR); .fi .LP .nf \fBtd_err_e\fR \fBtd_sync_get_stats\fR(\fBconst td_synchandle_t *\fR\fIsh_p\fR, \fBtd_syncstats_t *\fR\fIss_p\fR); .fi .LP .nf \fBtd_err_e\fR \fBtd_sync_setstate\fR(\fBconst td_synchandle_t *\fR\fIsh_p\fR); .fi .LP .nf \fBtypedef int\fR \fBtd_thr_iter_f\fR(\fBconst td_thrhandle_t *\fR\fIth_p\fR, \fBvoid *\fR\fIcb_data_p\fR); .fi .LP .nf \fBtd_err_e\fR \fBtd_sync_waiters\fR(\fBconst td_synchandle_t *\fR\fIsh_p\fR, \fBtd_thr_iter_f *\fR\fIcb\fR, \fBvoid *\fR\fIcb_data_p\fR); .fi .SH DESCRIPTION .sp .LP Synchronization objects include mutexes, condition variables, semaphores, and reader-writer locks. In the same way that thread operations use a thread handle of type \fBtd_thrhandle_t\fR, operations on synchronization objects use a synchronization object handle of type \fBtd_synchandle_t\fR. .sp .LP The controlling process obtains synchronization object handles either by calling the function \fBtd_ta_sync_iter()\fR to obtain handles for all synchronization objects of the target process that are known to the \fBlibc_db\fR library of interfaces, or by mapping the address of a synchronization object in the address space of the target process to a handle by calling \fBtd_ta_map_addr2sync\fR(3C_DB). .sp .LP Not all synchronization objects that a process uses can be known to the \fBlibc_db\fR library and returned by \fBtd_ta_sync_iter\fR(3C_DB). A synchronization object is known to \fBlibc_db\fR only if it has been the target of a synchronization primitive in the process (such as \fBmutex_lock()\fR, described on the \fBmutex_init\fR(3C) manual page) after \fBtd_ta_new\fR(3C_DB) has been called to attach to the process and \fBtd_ta_sync_tracking_enable()\fR has been called to enable synchronization object tracking. .sp .LP The \fBtd_ta_sync_tracking_enable()\fR function turns synchronization object tracking on or off for the process identified by \fIta_p\fR, depending on whether \fIon_off\fR is 0 (off) or non-zero (on). .sp .LP The \fBtd_sync_get_info()\fR function fills in the \fBtd_syncinfo_t\fR structure \fB*\fR\fIsi_p\fR with values for the synchronization object identified by \fBsh_p\fR. The \fBtd_syncinfo_t\fR structure contains the following fields: .sp .ne 2 .mk .na \fB\fBtd_thragent_t *\fR\fIsi_ta_p\fR\fR .ad .RS 29n .rt The internal process handle identifying the target process through which this synchronization object handle was obtained. Synchronization objects may be process-private or process-shared. In the latter case, the same synchronization object may have multiple handles, one for each target process's "view" of the synchronization object. .RE .sp .ne 2 .mk .na \fB\fBpsaddr_t\fR \fIsi_sv_addr\fR\fR .ad .RS 29n .rt The address of the synchronization object in this target process's address space. .RE .sp .ne 2 .mk .na \fB\fBtd_sync_type_e\fR \fIsi_type\fR\fR .ad .RS 29n .rt The type of the synchronization variable: mutex, condition variable, semaphore, or readers-writer lock. .RE .sp .ne 2 .mk .na \fB\fBint\fR \fIsi_shared_type\fR\fR .ad .RS 29n .rt If \fIsi_shared_type\fR is non-zero, this synchronization object is process-shared, otherwise it is process-private. .RE .sp .ne 2 .mk .na \fB\fBtd_sync_flags_t\fR \fIsi_flags\fR\fR .ad .RS 29n .rt Flags dependent on the type of the synchronization object. .RE .sp .ne 2 .mk .na \fB\fBint\fR \fIsi_state.sema_count\fR\fR .ad .RS 29n .rt Semaphores only. The current value of the semaphore .RE .sp .ne 2 .mk .na \fB\fBint\fR \fIsi_state.nreaders\fR\fR .ad .RS 29n .rt Readers-writer locks only. The number of readers currently holding the lock, or \fB-1\fR, if a writer is currently holding the lock. .RE .sp .ne 2 .mk .na \fB\fBint\fR \fIsi_state.mutex_locked\fR\fR .ad .RS 29n .rt For mutexes only. Non-zero if and only if the mutex is currently locked. .RE .sp .ne 2 .mk .na \fB\fBint\fR \fIsi_size\fR\fR .ad .RS 29n .rt The size of the synchronization object. .RE .sp .ne 2 .mk .na \fB\fBuint8_t\fR \fIsi_has_waiters\fR\fR .ad .RS 29n .rt Non-zero if and only if at least one thread is blocked on this synchronization object. .RE .sp .ne 2 .mk .na \fB\fBuint8_t\fR \fIsi_is_wlocked\fR\fR .ad .RS 29n .rt For reader-writer locks only. The value is non-zero if and only if this lock is held by a writer. .RE .sp .ne 2 .mk .na \fB\fBuint8_t\fR \fIsi_rcount\fR\fR .ad .RS 29n .rt \fBPTHREAD_MUTEX_RECURSIVE\fR mutexes only. If the mutex is held, the recursion count. .RE .sp .ne 2 .mk .na \fB\fBuint8_t\fR \fIsi_prioceiling\fR\fR .ad .RS 29n .rt \fBPTHREAD_PRIO_PROTECT\fR protocol mutexes only. The priority ceiling. .RE .sp .ne 2 .mk .na \fB\fBtd_thrhandle_t\fR \fIsi_owner\fR\fR .ad .RS 29n .rt Mutexes and readers-writer locks only. This is the thread holding the mutex, or the write lock, if this is a reader-writer lock. The value is \fINULL\fR if no one holds the mutex or write-lock. .RE .sp .ne 2 .mk .na \fB\fBpid_t\fR \fIsi_ownerpid\fR\fR .ad .RS 29n .rt Mutexes only. For a locked process-shared mutex, this is the process-ID of the process containing the owning thread. .RE .sp .LP The \fBtd_sync_get_stats()\fR function fills in the \fBtd_syncstats_t\fR structure *\fIss_p\fR with values for the synchronization object identified by \fIsh_p\fR. The \fBtd_syncstats_t\fR structure contains an embedded \fBtd_syncinfo_t\fR structure that is filled in as described above for \fBtd_sync_get_info()\fR. In addition, usage statistics gathered since \fBtd_ta_sync_tracking_enable()\fR was called to enable synchronization object tracking are returned in the \fBss_un.mutex\fR, \fBss_un.cond\fR, \fBss_un.rwlock\fR, or \fBss_un.sema\fR members of the \fBtd_syncstats_t\fR structure, depending on the type of the synchronization object. .sp .LP The \fBtd_sync_setstate\fR function modifies the state of synchronization object \fIsi_p\fR, depending on the synchronization object type. For mutexes, \fBtd_sync_setstate\fR is unlocked if the value is \fB0\fR. Otherwise it is locked. For semaphores, the semaphore's count is set to the value. For reader-writer locks, the reader count set to the value if value is \fB>0\fR. The count is set to write-locked if value is \fB-1\fR. It is set to unlocked if the value is \fB0\fR. Setting the state of a synchronization object from a \fBlibc_db\fR interface may cause the synchronization object's semantics to be violated from the point of view of the threads in the target process. For example, if a thread holds a mutex, and \fBtd_sync_setstate\fR is used to set the mutex to unlocked, then a different thread will also be able to subsequently acquire the same mutex. .sp .LP The \fBtd_sync_waiters\fR function iterates over the set of thread handles of threads blocked on \fIsh_p\fR. The callback function \fIcb\fR is called once for each such thread handle, and is passed the thread handle and \fIcb_data_p\fR. If the callback function returns a non-zero value, iteration is terminated early. See \fBtd_ta_thr_iter\fR(3C_DB). .SH RETURN VALUES .sp .ne 2 .mk .na \fB\fBTD_OK\fR \fR .ad .RS 12n .rt The call returned successfully. .RE .sp .ne 2 .mk .na \fB\fBTD_BADTH\fR \fR .ad .RS 12n .rt An invalid thread handle was passed in. .RE .sp .ne 2 .mk .na \fB\fBTD_DBERR\fR \fR .ad .RS 12n .rt A call to one of the imported interface routines failed. .RE .sp .ne 2 .mk .na \fB\fBTD_ERR\fR \fR .ad .RS 12n .rt A libc_db-internal error occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level Safe .TE .sp .SH SEE ALSO .sp .LP \fBtd_ta_map_addr2sync\fR(3C_DB), \fBtd_ta_sync_iter\fR(3C_DB), \fBtd_ta_thr_iter\fR(3C_DB), \fBmutex_init\fR(3C), \fBlibc_db\fR(3LIB), \fBattributes\fR(7)