summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread/uthread_info.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-01-17 23:58:11 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-01-17 23:58:11 +0000
commit46b689c0962ca1c667dfdfc76b8e6fafc1eef2bc (patch)
tree7e685780f23dec9017d270df254797b6f49b4191 /lib/libc_r/uthread/uthread_info.c
parent5ca1f71120ac2bc81b65a6cef298606b92242903 (diff)
show cancellation and exiting flags
Diffstat (limited to 'lib/libc_r/uthread/uthread_info.c')
-rw-r--r--lib/libc_r/uthread/uthread_info.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc_r/uthread/uthread_info.c b/lib/libc_r/uthread/uthread_info.c
index cd1f5816355..53b1e220f1d 100644
--- a/lib/libc_r/uthread/uthread_info.c
+++ b/lib/libc_r/uthread/uthread_info.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: uthread_info.c,v 1.5 1999/01/06 05:29:24 d Exp $
+ * $OpenBSD: uthread_info.c,v 1.6 1999/01/17 23:58:10 d Exp $
*/
#include <stdio.h>
#include <fcntl.h>
@@ -108,7 +108,7 @@ _thread_dump_info(void)
/* Display a list of active threads */
- snprintf(s, sizeof s, " %8s%c%-11s %2s %4s %-8s %5s %5s %s\n",
+ snprintf(s, sizeof s, " %8s%c%-11s %2s %5s %-8s %5s %5s %s\n",
"id", ' ', "state", "pr", "flag", "name", "utime", "stime",
"location");
_thread_sys_write(fd, s, strlen(s));
@@ -135,11 +135,14 @@ _thread_dump_info(void)
/* Output a record for the current thread: */
s[0] = 0;
snprintf(s, sizeof(s),
- " %8p%c%-11s %2d %c%c%c%c %-8s %5.2f %5.2f %s\n",
+ " %8p%c%-11s %2d %c%c%c%c%c %-8s %5.2f %5.2f %s\n",
(void *)pthread,
(pthread == _thread_run) ? '*' : ' ',
state,
pthread->pthread_priority,
+ (pthread->flags & PTHREAD_EXITING) ? 'E' :
+ (pthread->flags & PTHREAD_CANCELLING) ? 'C' :
+ (pthread->flags & PTHREAD_AT_CANCEL_POINT) ? 'c' : ' ',
(pthread->attr.flags & PTHREAD_DETACHED) ? 'D' : ' ',
(pthread->attr.flags & PTHREAD_SCOPE_SYSTEM) ? 'S' : ' ',
(pthread->attr.flags & PTHREAD_INHERIT_SCHED) ? 'I' : ' ',