From 2e3100b5472a1681f180c58f1b10e6af461d6176 Mon Sep 17 00:00:00 2001 From: davidxu Date: Tue, 13 Jul 2004 22:49:58 +0000 Subject: 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. --- lib/libpthread/thread/thr_exit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libpthread/thread/thr_exit.c') 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); -- cgit v1.1