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
This commit is contained in:
brian 2007-03-05 17:47:27 +00:00
parent f650676d7d
commit cdf4f0e426
2 changed files with 8 additions and 14 deletions

View File

@ -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;

View File

@ -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;