summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_exit.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2004-07-13 22:49:58 +0000
committerdavidxu <davidxu@FreeBSD.org>2004-07-13 22:49:58 +0000
commit2e3100b5472a1681f180c58f1b10e6af461d6176 (patch)
treefb610eb65d694e498ffb6de577dfc89b9d9f9f4e /lib/libpthread/thread/thr_exit.c
parent512283ce25f97070fe9a81cb0695d87c31622254 (diff)
downloadFreeBSD-src-2e3100b5472a1681f180c58f1b10e6af461d6176.zip
FreeBSD-src-2e3100b5472a1681f180c58f1b10e6af461d6176.tar.gz
Add code to support thread debugging.
1. Add global varible _libkse_debug, debugger uses the varible to identify libpthread. when the varible is written to non-zero by debugger, libpthread will take some special action at context switch time, it will check TMDF_DOTRUNUSER flags, if a thread has the flags set by debugger, it won't be scheduled, when a thread leaves KSE critical region, thread checks the flag, if it was set, the thread relinquish CPU. 2. Add pq_first_debug to select a thread allowd to run by debugger. 3. Some names prefixed with _thr are renamed to _thread prefix. which is allowed to run by debugger.
Diffstat (limited to 'lib/libpthread/thread/thr_exit.c')
-rw-r--r--lib/libpthread/thread/thr_exit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c
index 416709a..22aa875 100644
--- a/lib/libpthread/thread/thr_exit.c
+++ b/lib/libpthread/thread/thr_exit.c
@@ -125,11 +125,11 @@ _pthread_exit(void *status)
curkse = _get_curkse();
KSE_LOCK_ACQUIRE(curkse, &_thread_list_lock);
/* Use thread_list_lock */
- _thr_active_threads--;
+ _thread_active_threads--;
#ifdef SYSTEM_SCOPE_ONLY
- if (_thr_active_threads == 0) {
+ if (_thread_active_threads == 0) {
#else
- if (_thr_active_threads == 1) {
+ if (_thread_active_threads == 1) {
#endif
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
_kse_critical_leave(crit);
OpenPOWER on IntegriCloud