Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread_dbg Kill SA thread states (TD_STATE_*) in pth...
details: https://anonhg.NetBSD.org/src/rev/e3ea1cec6473
branches: trunk
changeset: 349032:e3ea1cec6473
user: kamil <kamil%NetBSD.org@localhost>
date: Mon Nov 21 03:02:34 2016 +0000
description:
Kill SA thread states (TD_STATE_*) in pthread_dbg and add TD_STATE_DEAD
Scheduler Activation types were removed in NetBSD 5.0. Old type set is not
matching the new world POSIX threads library.
Only TD_STATE_RUNNING, TD_STATE_ZOMBIE are still applicable - keep it.
Keep TD_STATE_UNKNOWN as generic unrecognized type.
Add new TD_STATE_DEAD one. The TD_STATE_DEAD type is represented by number
6 in the POSIX threads library, but for the sake of compatibility with
older software using pthread_dbg - renumber it to 7, as six was reserved
for TD_STATE_SUSPENDED.
Old removed state types are marked as reserved and unused.
Sponsored by <The NetBSD Foundation>
diffstat:
lib/libpthread_dbg/pthread_dbg.c | 14 +++++++-------
lib/libpthread_dbg/pthread_dbg.h | 11 ++++++-----
2 files changed, 13 insertions(+), 12 deletions(-)
diffs (78 lines):
diff -r 7c4a75b3636d -r e3ea1cec6473 lib/libpthread_dbg/pthread_dbg.c
--- a/lib/libpthread_dbg/pthread_dbg.c Mon Nov 21 01:19:35 2016 +0000
+++ b/lib/libpthread_dbg/pthread_dbg.c Mon Nov 21 03:02:34 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_dbg.c,v 1.48 2016/11/20 21:49:24 kamil Exp $ */
+/* $NetBSD: pthread_dbg.c,v 1.49 2016/11/21 03:02:34 kamil Exp $ */
/*-
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_dbg.c,v 1.48 2016/11/20 21:49:24 kamil Exp $");
+__RCSID("$NetBSD: pthread_dbg.c,v 1.49 2016/11/21 03:02:34 kamil Exp $");
#define __EXPOSE_STACK 1
@@ -225,14 +225,12 @@
case PT_STATE_RUNNING:
info->thread_state = TD_STATE_RUNNING;
break;
-#ifdef XXXLWP
- case PT_STATE_SUSPENDED:
- info->thread_state = TD_STATE_SUSPENDED;
- break;
-#endif
case PT_STATE_ZOMBIE:
info->thread_state = TD_STATE_ZOMBIE;
break;
+ case PT_STATE_DEAD:
+ info->thread_state = TD_STATE_DEAD;
+ break;
default:
info->thread_state = TD_STATE_UNKNOWN;
}
@@ -306,6 +304,7 @@
return val;
break;
case PT_STATE_ZOMBIE:
+ case PT_STATE_DEAD:
default:
return TD_ERR_BADTHREAD;
}
@@ -333,6 +332,7 @@
return val;
break;
case PT_STATE_ZOMBIE:
+ case PT_STATE_DEAD:
default:
return TD_ERR_BADTHREAD;
}
diff -r 7c4a75b3636d -r e3ea1cec6473 lib/libpthread_dbg/pthread_dbg.h
--- a/lib/libpthread_dbg/pthread_dbg.h Mon Nov 21 01:19:35 2016 +0000
+++ b/lib/libpthread_dbg/pthread_dbg.h Mon Nov 21 03:02:34 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_dbg.h,v 1.7 2016/10/22 18:04:40 skrll Exp $ */
+/* $NetBSD: pthread_dbg.h,v 1.8 2016/11/21 03:02:34 kamil Exp $ */
/*-
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -77,11 +77,12 @@
#define TD_STATE_UNKNOWN 0
#define TD_STATE_RUNNING 1 /* On a processor */
-#define TD_STATE_RUNNABLE 2 /* On a run queue */
-#define TD_STATE_BLOCKED 3 /* Blocked in the kernel */
-#define TD_STATE_SLEEPING 4 /* Blocked on a sync object */
+#define TD_STATE_UNUSED2 2 /* former TD_STATE_RUNNABLE for SA */
+#define TD_STATE_UNUSED3 3 /* former TD_STATE_BLOCKED for SA */
+#define TD_STATE_UNUSED4 4 /* former TD_STATE_SLEEPING for SA */
#define TD_STATE_ZOMBIE 5
-#define TD_STATE_SUSPENDED 6 /* Removed from run queues */
+#define TD_STATE_UNUSED6 6 /* former TD_STATE_SUSPENDED for SA */
+#define TD_STATE_DEAD 7
#define TD_TYPE_UNKNOWN 0
#define TD_TYPE_USER 1
Home |
Main Index |
Thread Index |
Old Index