Subject: Re: New spl level: splsched()
To: Eduardo E. Horvath <email@example.com>
From: Bill Sommerfeld <firstname.lastname@example.org>
Date: 03/06/1997 14:54:21
> #define mutex_init(m,s) (m).spl=(s)
> #define mutex_enter(m) (m).oldspl = splraise((m).spl)
> #define mutex_exit(m) splx((m).oldspl)
> You will need to replace all the spl stuff with this. Then you can
> start worrying about isolating critical sections that are not currently
> protected due to our single-threaded kernel design.
The problem with this implementation is that `oldspl' needs to be
stuffed in a temporary variable with a scope covering the lock/unlock,
not in a global variable..
i.e., it's currently legal to do:
x = splfoo();
y = splfoo();
Nesting your mutex_enter/mutex_exit, on the other hand, leave things
locked on exit...