diff options
author | davidxu <davidxu@FreeBSD.org> | 2002-09-05 07:30:18 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2002-09-05 07:30:18 +0000 |
commit | b1d94c37f75017a140121c9735033fcb62e8d0d3 (patch) | |
tree | 137cfbb681f0fc0991a608cc3e54a93dc25c64dc /sys/kern | |
parent | 725b1916bdb3e6e0e9a4c6a986ad2e2e5a3502af (diff) | |
download | FreeBSD-src-b1d94c37f75017a140121c9735033fcb62e8d0d3.zip FreeBSD-src-b1d94c37f75017a140121c9735033fcb62e8d0d3.tar.gz |
s/SGNL/SIG/
s/SNGL/SINGLE/
s/SNGLE/SINGLE/
Fix abbreviation for P_STOPPED_* etc flags, in original code they were
inconsistent and difficult to distinguish between them.
Approved by: julian (mentor)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_exec.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_exit.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_fork.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_kse.c | 22 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 22 | ||||
-rw-r--r-- | sys/kern/sys_process.c | 2 |
7 files changed, 29 insertions, 29 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1ee302a..8423f62 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -162,7 +162,7 @@ execve(td, uap) KASSERT((p->p_flag & P_INEXEC) == 0, ("%s(): process already has P_INEXEC flag", __func__)); if (p->p_flag & P_KSES) { - if (thread_single(SNGLE_EXIT)) { + if (thread_single(SINGLE_EXIT)) { PROC_UNLOCK(p); return (ERESTART); /* Try again later. */ } diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index fea5438..8a57e1d 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -178,7 +178,7 @@ exit1(td, rv) * from userret(). thread_exit() will unsuspend us * when the last other thread exits. */ - if (thread_single(SNGLE_EXIT)) { + if (thread_single(SINGLE_EXIT)) { panic ("Exit: Single threading fouled up"); } /* diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 5f9d1bd..a0429b2 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -291,7 +291,7 @@ fork1(td, flags, procp) * be aborted in the child. */ PROC_LOCK(p1); - if (thread_single(SNGLE_NO_EXIT)) { + if (thread_single(SINGLE_NO_EXIT)) { /* Abort.. someone else is single threading before us */ PROC_UNLOCK(p1); return (ERESTART); diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index ce2b125..26a4707 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -346,10 +346,10 @@ thread_exit(void) kg->kg_numthreads--; /* * The test below is NOT true if we are the - * sole exiting thread. P_STOPPED_SNGL is unset + * sole exiting thread. P_STOPPED_SINGLE is unset * in exit1() after it is the only survivor. */ - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount) { TAILQ_REMOVE(&p->p_suspended, p->p_singlethread, td_runq); @@ -596,11 +596,11 @@ thread_single(int force_exit) if (p->p_singlethread) return (1); - if (force_exit == SNGLE_EXIT) + if (force_exit == SINGLE_EXIT) p->p_flag |= P_SINGLE_EXIT; else p->p_flag &= ~P_SINGLE_EXIT; - p->p_flag |= P_STOPPED_SNGL; + p->p_flag |= P_STOPPED_SINGLE; p->p_singlethread = td; while ((p->p_numthreads - p->p_suspcount) != 1) { FOREACH_THREAD_IN_PROC(p, td2) { @@ -608,7 +608,7 @@ thread_single(int force_exit) continue; switch(td2->td_state) { case TDS_SUSPENDED: - if (force_exit == SNGLE_EXIT) { + if (force_exit == SINGLE_EXIT) { mtx_lock_spin(&sched_lock); TAILQ_REMOVE(&p->p_suspended, td, td_runq); @@ -688,7 +688,7 @@ thread_suspend_check(int return_instead) p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); while (P_SHOULDSTOP(p)) { - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { KASSERT(p->p_singlethread != NULL, ("singlethread not set")); /* @@ -706,7 +706,7 @@ thread_suspend_check(int return_instead) /* * If the process is waiting for us to exit, * this thread should just suicide. - * Assumes that P_SINGLE_EXIT implies P_STOPPED_SNGL. + * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { mtx_lock_spin(&sched_lock); @@ -729,7 +729,7 @@ thread_suspend_check(int return_instead) * and can only be lent in STOPPED state. */ mtx_lock_spin(&sched_lock); - if ((p->p_flag & P_STOPPED_SGNL) && + if ((p->p_flag & P_STOPPED_SIG) && (p->p_suspcount+1 == p->p_numthreads)) { mtx_unlock_spin(&sched_lock); PROC_LOCK(p->p_pptr); @@ -745,7 +745,7 @@ thread_suspend_check(int return_instead) td->td_state = TDS_SUSPENDED; TAILQ_INSERT_TAIL(&p->p_suspended, td, td_runq); PROC_UNLOCK(p); - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount) { TAILQ_REMOVE(&p->p_suspended, p->p_singlethread, td_runq); @@ -805,7 +805,7 @@ thread_unsuspend(struct proc *p) while (( td = TAILQ_FIRST(&p->p_suspended))) { thread_unsuspend_one(td); } - } else if ((P_SHOULDSTOP(p) == P_STOPPED_SNGL) && + } else if ((P_SHOULDSTOP(p) == P_STOPPED_SINGLE) && (p->p_numthreads == p->p_suspcount)) { /* * Stopping everything also did the job for the single @@ -825,7 +825,7 @@ thread_single_end(void) td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); - p->p_flag &= ~P_STOPPED_SNGL; + p->p_flag &= ~P_STOPPED_SINGLE; p->p_singlethread = NULL; /* * If there are other threads they mey now run, diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c3cc40f..5dbb757 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1363,7 +1363,7 @@ psignal(p, sig) * an event, it goes back to run state. * Otherwise, process goes back to sleep state. */ - p->p_flag &= ~P_STOPPED_SGNL; + p->p_flag &= ~P_STOPPED_SIG; p->p_flag |= P_CONTINUED; if (action == SIG_DFL) { SIGDELSET(p->p_siglist, sig); @@ -1395,7 +1395,7 @@ psignal(p, sig) * (If we did the shell could get confused). * Just make sure the signal STOP bit set. */ - p->p_flag |= P_STOPPED_SGNL; + p->p_flag |= P_STOPPED_SIG; SIGDELSET(p->p_siglist, sig); goto out; } @@ -1770,7 +1770,7 @@ stop(p) { PROC_LOCK_ASSERT(p, MA_OWNED); - p->p_flag |= P_STOPPED_SGNL; + p->p_flag |= P_STOPPED_SIG; p->p_flag &= ~P_WAITED; wakeup(p->p_pptr); } diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index ce2b125..26a4707 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -346,10 +346,10 @@ thread_exit(void) kg->kg_numthreads--; /* * The test below is NOT true if we are the - * sole exiting thread. P_STOPPED_SNGL is unset + * sole exiting thread. P_STOPPED_SINGLE is unset * in exit1() after it is the only survivor. */ - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount) { TAILQ_REMOVE(&p->p_suspended, p->p_singlethread, td_runq); @@ -596,11 +596,11 @@ thread_single(int force_exit) if (p->p_singlethread) return (1); - if (force_exit == SNGLE_EXIT) + if (force_exit == SINGLE_EXIT) p->p_flag |= P_SINGLE_EXIT; else p->p_flag &= ~P_SINGLE_EXIT; - p->p_flag |= P_STOPPED_SNGL; + p->p_flag |= P_STOPPED_SINGLE; p->p_singlethread = td; while ((p->p_numthreads - p->p_suspcount) != 1) { FOREACH_THREAD_IN_PROC(p, td2) { @@ -608,7 +608,7 @@ thread_single(int force_exit) continue; switch(td2->td_state) { case TDS_SUSPENDED: - if (force_exit == SNGLE_EXIT) { + if (force_exit == SINGLE_EXIT) { mtx_lock_spin(&sched_lock); TAILQ_REMOVE(&p->p_suspended, td, td_runq); @@ -688,7 +688,7 @@ thread_suspend_check(int return_instead) p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); while (P_SHOULDSTOP(p)) { - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { KASSERT(p->p_singlethread != NULL, ("singlethread not set")); /* @@ -706,7 +706,7 @@ thread_suspend_check(int return_instead) /* * If the process is waiting for us to exit, * this thread should just suicide. - * Assumes that P_SINGLE_EXIT implies P_STOPPED_SNGL. + * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { mtx_lock_spin(&sched_lock); @@ -729,7 +729,7 @@ thread_suspend_check(int return_instead) * and can only be lent in STOPPED state. */ mtx_lock_spin(&sched_lock); - if ((p->p_flag & P_STOPPED_SGNL) && + if ((p->p_flag & P_STOPPED_SIG) && (p->p_suspcount+1 == p->p_numthreads)) { mtx_unlock_spin(&sched_lock); PROC_LOCK(p->p_pptr); @@ -745,7 +745,7 @@ thread_suspend_check(int return_instead) td->td_state = TDS_SUSPENDED; TAILQ_INSERT_TAIL(&p->p_suspended, td, td_runq); PROC_UNLOCK(p); - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount) { TAILQ_REMOVE(&p->p_suspended, p->p_singlethread, td_runq); @@ -805,7 +805,7 @@ thread_unsuspend(struct proc *p) while (( td = TAILQ_FIRST(&p->p_suspended))) { thread_unsuspend_one(td); } - } else if ((P_SHOULDSTOP(p) == P_STOPPED_SNGL) && + } else if ((P_SHOULDSTOP(p) == P_STOPPED_SINGLE) && (p->p_numthreads == p->p_suspcount)) { /* * Stopping everything also did the job for the single @@ -825,7 +825,7 @@ thread_single_end(void) td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); - p->p_flag &= ~P_STOPPED_SNGL; + p->p_flag &= ~P_STOPPED_SINGLE; p->p_singlethread = NULL; /* * If there are other threads they mey now run, diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 69c0d6f..1067314 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -600,7 +600,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) if (P_SHOULDSTOP(p)) { p->p_xstat = data; mtx_lock_spin(&sched_lock); - p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SGNL); + p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG); setrunnable(td2); /* XXXKSE */ /* Need foreach kse in proc, ... make_kse_queued(). */ mtx_unlock_spin(&sched_lock); |