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:
parent
eda6d52241
commit
e7578c3795
@ -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;
|
||||
|
@ -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. */
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
/*
|
||||
|
@ -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;
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user