- Better fix for previous error; use DEVOLATILE on the td_lock pointer

it can actually sometimes be something other than sched_lock even on
   schedulers which rely on a global scheduler lock.

Tested by:	kan
This commit is contained in:
Jeff Roberson 2007-06-05 04:12:46 +00:00
parent c219b097af
commit 95e3a0bca3
2 changed files with 2 additions and 2 deletions

View File

@ -903,7 +903,7 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
#endif
/* I feel sleepy */
cpu_switch(td, newtd, &sched_lock);
cpu_switch(td, newtd, __DEVOLATILE(struct mtx *, td->td_lock));
/*
* Where am I? What year is it?
* We are in the same thread that went to sleep above,

View File

@ -1487,7 +1487,7 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
#endif
cpu_switch(td, newtd, &sched_lock);
cpu_switch(td, newtd, __DEVOLATILE(struct mtx *, td->td_lock));
#ifdef HWPMC_HOOKS
if (PMC_PROC_IS_USING_PMCS(td->td_proc))
PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN);