[...]
Right. This implemention also looks free of race conditions, provided that
- rspin_lock, rspin_try_lock, and rspin_unlock are only called in
contexts with disabled preemption and disabled local interrupts,
- rspin_unlock() rewrites rlock->processor to "no CPU" before
it drops the lock. (The implementation in
mdb-2.6.27-rc2-ia32-08-07-08.patch does so.)
BTW, the rspin_try_lock() in that patch wrong: It always returns 0
instead of having three branches of execution which return 0/1/-1.
--
Stefan Richter
-=====-==--- =--- -=--=
http://arcgraph.de/sr/
--