Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Document td_thr_info(3) from libpthread_dbg(3)



details:   https://anonhg.NetBSD.org/src/rev/fbbebf765ccb
branches:  trunk
changeset: 349055:fbbebf765ccb
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon Nov 21 22:19:03 2016 +0000

description:
Document td_thr_info(3) from libpthread_dbg(3)

td_thr_info - get information on a thread

Currently a subset of td_thread_info_t is documented. This version
describes thread_addr and thread_state.

Sponsored by <The NetBSD Foundation>

diffstat:

 distrib/sets/lists/comp/mi       |    5 +-
 lib/libpthread_dbg/Makefile      |    3 +-
 lib/libpthread_dbg/td_thr_info.3 |  109 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 115 insertions(+), 2 deletions(-)

diffs (163 lines):

diff -r ad2c95847887 -r fbbebf765ccb distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Mon Nov 21 21:03:22 2016 +0000
+++ b/distrib/sets/lists/comp/mi        Mon Nov 21 22:19:03 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2070 2016/11/21 20:43:25 kamil Exp $
+#      $NetBSD: mi,v 1.2071 2016/11/21 22:19:03 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -9364,6 +9364,7 @@
 ./usr/share/man/cat3/tcsetpgrp.0               comp-c-catman           .cat
 ./usr/share/man/cat3/td_close.0                        comp-c-catman           .cat
 ./usr/share/man/cat3/td_open.0                 comp-c-catman           .cat
+./usr/share/man/cat3/td_thr_info.0             comp-c-catman           .cat
 ./usr/share/man/cat3/tdelete.0                 comp-c-catman           .cat
 ./usr/share/man/cat3/telldir.0                 comp-c-catman           .cat
 ./usr/share/man/cat3/tempnam.0                 comp-c-catman           .cat
@@ -16622,6 +16623,7 @@
 ./usr/share/man/html3/tcsetpgrp.html           comp-c-htmlman          html
 ./usr/share/man/html3/td_close.html            comp-c-htmlman          html
 ./usr/share/man/html3/td_open.html             comp-c-htmlman          html
+./usr/share/man/html3/td_thr_info.html         comp-c-htmlman          html
 ./usr/share/man/html3/tdelete.html             comp-c-htmlman          html
 ./usr/share/man/html3/telldir.html             comp-c-htmlman          html
 ./usr/share/man/html3/tempnam.html             comp-c-htmlman          html
@@ -23941,6 +23943,7 @@
 ./usr/share/man/man3/tcsetpgrp.3               comp-c-man              .man
 ./usr/share/man/man3/td_close.3                        comp-c-man              .man
 ./usr/share/man/man3/td_open.3                 comp-c-man              .man
+./usr/share/man/man3/td_thr_info.3             comp-c-man              .man
 ./usr/share/man/man3/tdelete.3                 comp-c-man              .man
 ./usr/share/man/man3/telldir.3                 comp-c-man              .man
 ./usr/share/man/man3/tempnam.3                 comp-c-man              .man
diff -r ad2c95847887 -r fbbebf765ccb lib/libpthread_dbg/Makefile
--- a/lib/libpthread_dbg/Makefile       Mon Nov 21 21:03:22 2016 +0000
+++ b/lib/libpthread_dbg/Makefile       Mon Nov 21 22:19:03 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.12 2016/11/21 20:43:25 kamil Exp $
+#      $NetBSD: Makefile,v 1.13 2016/11/21 22:19:03 kamil Exp $
 #
 
 WARNS?=                5
@@ -42,6 +42,7 @@
 
 MAN+=  pthread_dbg.3
 MAN+=  td_open.3
+MAN+=  td_thr_info.3
 
 MLINKS+=       td_open.3 td_close.3
 
diff -r ad2c95847887 -r fbbebf765ccb lib/libpthread_dbg/td_thr_info.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libpthread_dbg/td_thr_info.3  Mon Nov 21 22:19:03 2016 +0000
@@ -0,0 +1,109 @@
+.\"    $NetBSD: td_thr_info.3,v 1.1 2016/11/21 22:19:03 kamil Exp $
+.\"
+.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd November 21, 2016
+.Dt TD_THR_INFO 3
+.Os
+.Sh NAME
+.Nm td_thr_info
+.Nd get information on a thread
+.Sh LIBRARY
+.Lb libpthread_dbg
+.Sh SYNOPSIS
+.In pthread_dbg.h
+.Ft int
+.Fn td_thr_info "td_thread_t *thread" "td_thread_info_t *info"
+.Sh DESCRIPTION
+The
+.Fn td_thr_info
+function retrieves information on a thread specified in the
+.Fa thread
+argument
+and saves the result in
+.Fa info .
+.Pp
+In the
+.Dv td_thread_info_t
+structure there are defined the following members:
+.Bl -column "thread_state" "caddr_t" "Pointer to underlaying Dv pthread_t object"
+.It Sy Name      Ta Sy Type     Ta Sy Description
+.It thread_addr  Ta Dv caddr_t  Ta Points to underlaying Dv pthread_t object
+.It thread_state Ta Dv int      Ta Defines Dv TD_STATE of the thread
+.\" TODO: Add ATF tests, verify and document:
+.\" thread_type
+.\" thread_id 
+.\" thread_stack
+.\" thread_hasjoiners
+.\" thread_tls
+.\" thread_errno
+.\" thread_sigmask
+.\" thread_sigpending
+.El
+.Ss Thread State types
+The following state types are possible in
+.Dv thread_state :
+.Pp
+.Bl -column ".Sy TD_STATE_RUNNING" "Thread is alive" -compact
+.It Dv TD_STATE_UNKNOWN Ta "Unknown state"
+.It Dv TD_STATE_RUNNING Ta "Thread is alive"
+.It Dv TD_STATE_ZOMBIE  Ta "Thread is in the zombie state"
+.It Dv TD_STATE_DEAD    Ta "Thread is dead"
+.El
+.Pp
+It is not possible to retrieve with this interface information whether a thread
+is suspended or resumed,
+as this data is stored only inside the kernel and not in the
+.Dv pthread_t
+object.
+The
+.Dv TD_STATE_RUNNING
+name is kept for backwards compatibility with old Scheduler Activation threads.
+The
+.Dv TD_STATE_RUNNING
+state might be returned only for mismatch between versions of
+.Xr pthread 3
+and
+.Xr pthread_dbg 3 .
+.Sh RETURN VALUES
+If successful, the
+.Nm
+function will return
+.Dv TD_ERR_OK .
+Otherwise an error number will be returned to indicate failure as described in
+.Xr pthread_dbg 3 .
+.Sh SEE ALSO
+.Xr pthread 3 ,
+.Xr pthread_dbg 3
+.Sh HISTORY
+The
+.Nm
+function first appeared in
+.Nx 2.0 .
+.Sh AUTHORS
+.An Nathan J. Williams Aq Mt nathanw%NetBSD.org@localhost
+.Pp
+This manual page was written by
+.An Kamil Rytarowski Aq Mt kamil%NetBSD.org@localhost .



Home | Main Index | Thread Index | Old Index