Clear KSE thread flags after KSE thread mode is ended. The side effect

of not clearing the flags for execv() syscall will result that a new
program runs in KSE thread mode without enabling it.

Submitted by: tjr
Modified by: davidxu
This commit is contained in:
davidxu 2004-05-21 14:50:23 +00:00
parent eda6d52241
commit e7578c3795
4 changed files with 8 additions and 2 deletions

View File

@ -266,6 +266,9 @@ kern_execve(td, fname, argv, envv, mac_p)
*/
p->p_flag &= ~P_SA;
td->td_mailbox = NULL;
mtx_lock_spin(&sched_lock);
td->td_flags &= ~TDF_SA;
mtx_unlock_spin(&sched_lock);
thread_single_end();
}
p->p_flag |= P_INEXEC;

View File

@ -162,6 +162,9 @@ exit1(struct thread *td, int rv)
* Turn off threading support.
*/
p->p_flag &= ~P_SA;
mtx_lock_spin(&sched_lock);
td->td_flags &= ~TDF_SA;
mtx_unlock_spin(&sched_lock);
thread_single_end(); /* Don't need this any more. */
}

View File

@ -2217,7 +2217,7 @@ thread_single_end(void)
td = curthread;
p = td->td_proc;
PROC_LOCK_ASSERT(p, MA_OWNED);
p->p_flag &= ~P_STOPPED_SINGLE;
p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT);
mtx_lock_spin(&sched_lock);
p->p_singlethread = NULL;
/*

View File

@ -2217,7 +2217,7 @@ thread_single_end(void)
td = curthread;
p = td->td_proc;
PROC_LOCK_ASSERT(p, MA_OWNED);
p->p_flag &= ~P_STOPPED_SINGLE;
p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT);
mtx_lock_spin(&sched_lock);
p->p_singlethread = NULL;
/*