summaryrefslogtreecommitdiffstats
path: root/lib/libkse
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2007-03-05 17:47:27 +0000
committerbrian <brian@FreeBSD.org>2007-03-05 17:47:27 +0000
commitcdf4f0e4261561026225257dc9974e5331b4d608 (patch)
treefba9c55c660a6349fe83984ae7f6a4012d3b2e29 /lib/libkse
parentf650676d7dc494534905e8aedc6cbf5851bbd4de (diff)
downloadFreeBSD-src-cdf4f0e4261561026225257dc9974e5331b4d608.zip
FreeBSD-src-cdf4f0e4261561026225257dc9974e5331b4d608.tar.gz
In the NOTYET code path when a process forks, the remaining
child thread goes back to system scope rather than process scope. This allows an ensuing exec() to actually work. This change was made a year ago here, but I "forgot" to commit it :( Approved by: deischen MFC after: 3 weeks
Diffstat (limited to 'lib/libkse')
-rw-r--r--lib/libkse/thread/thr_kern.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c
index 02ced94..20e8173 100644
--- a/lib/libkse/thread/thr_kern.c
+++ b/lib/libkse/thread/thr_kern.c
@@ -228,6 +228,10 @@ _kse_single_thread(struct pthread *curthread)
__sys_sigprocmask(SIG_SETMASK, &curthread->sigmask, NULL);
_thread_active_threads = 1;
+ curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
+ curthread->attr.flags &= ~PTHREAD_SCOPE_SYSTEM;
+ curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
+
/*
* Enter a loop to remove and free all threads other than
* the running thread from the active thread list:
@@ -310,13 +314,6 @@ _kse_single_thread(struct pthread *curthread)
inited = 0;
}
- /*
- * After a fork(), the leftover thread goes back to being
- * scope process.
- */
- curthread->attr.flags &= ~PTHREAD_SCOPE_SYSTEM;
- curthread->attr.flags |= PTHREAD_SCOPE_PROCESS;
-
/* We're no longer part of any lists */
curthread->tlflags = 0;
OpenPOWER on IntegriCloud