From e81bbed597a0ea8392ded3f1161aa98151c496a5 Mon Sep 17 00:00:00 2001 From: David Xu Date: Mon, 18 Aug 2003 03:58:29 +0000 Subject: Treat initial thread as scope system thread when KSE mode is not activated yet, so we can protect some locking code from being interrupted by signal handling. When KSE mode is turned on, reset the thread flag to scope process except we are running in 1:1 mode which we needn't turn it off. Also remove some unused member variables in structure kse. Tested by: deischen --- lib/libpthread/thread/thr_yield.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libpthread/thread/thr_yield.c') diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c index 1133784945a98..5c24113c27676 100644 --- a/lib/libpthread/thread/thr_yield.c +++ b/lib/libpthread/thread/thr_yield.c @@ -42,7 +42,7 @@ _sched_yield(void) { struct pthread *curthread = _get_curthread(); - if (!_kse_isthreaded() || curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) + if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) return (__sys_sched_yield()); /* Reset the accumulated time slice value for the current thread: */ @@ -60,8 +60,7 @@ _pthread_yield(void) { struct pthread *curthread = _get_curthread(); - if (!_kse_isthreaded() || - curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { + if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { __sys_sched_yield(); return; } -- cgit v1.2.3