1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-27 16:39:08 +00:00

The cold and panicstr variables do not need to be protected by sched_lock.

Submitted by:	Jennifer Yang (yangjihui@yahoo.com)
Reviewed by:	jake & jhb in principle
This commit is contained in:
Jeffrey Hsu 2002-04-23 19:50:22 +00:00
parent 2285b09474
commit 4bc37205bc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95322

View File

@ -205,7 +205,6 @@ cv_wait(struct cv *cvp, struct mtx *mp)
WITNESS_SLEEP(0, &mp->mtx_object);
WITNESS_SAVE(&mp->mtx_object, mp);
mtx_lock_spin(&sched_lock);
if (cold || panicstr) {
/*
* After a panic, or during autoconfiguration, just give
@ -213,9 +212,11 @@ cv_wait(struct cv *cvp, struct mtx *mp)
* thread or panic below, in case this is the idle process and
* already asleep.
*/
mtx_unlock_spin(&sched_lock);
return;
}
mtx_lock_spin(&sched_lock);
CV_WAIT_VALIDATE(cvp, mp);
DROP_GIANT();
@ -260,7 +261,6 @@ cv_wait_sig(struct cv *cvp, struct mtx *mp)
WITNESS_SLEEP(0, &mp->mtx_object);
WITNESS_SAVE(&mp->mtx_object, mp);
mtx_lock_spin(&sched_lock);
if (cold || panicstr) {
/*
* After a panic, or during autoconfiguration, just give
@ -268,9 +268,11 @@ cv_wait_sig(struct cv *cvp, struct mtx *mp)
* procs or panic below, in case this is the idle process and
* already asleep.
*/
mtx_unlock_spin(&sched_lock);
return 0;
}
mtx_lock_spin(&sched_lock);
CV_WAIT_VALIDATE(cvp, mp);
DROP_GIANT();
@ -320,13 +322,12 @@ cv_timedwait(struct cv *cvp, struct mtx *mp, int timo)
td = curthread;
rval = 0;
#ifdef KTRACE
ktrcsw(td->td_proc->p_tracep, 1, 0);
ktrcsw(td->td_proc->p_tracep, 1, 0);
#endif
CV_ASSERT(cvp, mp, td);
WITNESS_SLEEP(0, &mp->mtx_object);
WITNESS_SAVE(&mp->mtx_object, mp);
mtx_lock_spin(&sched_lock);
if (cold || panicstr) {
/*
* After a panic, or during autoconfiguration, just give
@ -334,9 +335,11 @@ cv_timedwait(struct cv *cvp, struct mtx *mp, int timo)
* thread or panic below, in case this is the idle process and
* already asleep.
*/
mtx_unlock_spin(&sched_lock);
return 0;
}
mtx_lock_spin(&sched_lock);
CV_WAIT_VALIDATE(cvp, mp);
DROP_GIANT();
@ -399,7 +402,6 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo)
WITNESS_SLEEP(0, &mp->mtx_object);
WITNESS_SAVE(&mp->mtx_object, mp);
mtx_lock_spin(&sched_lock);
if (cold || panicstr) {
/*
* After a panic, or during autoconfiguration, just give
@ -407,9 +409,11 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo)
* thread or panic below, in case this is the idle process and
* already asleep.
*/
mtx_unlock_spin(&sched_lock);
return 0;
}
mtx_lock_spin(&sched_lock);
CV_WAIT_VALIDATE(cvp, mp);
DROP_GIANT();