Fix a bug in the serializer's race detection code. It is possible for
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 26 May 2005 09:10:10 +0000 (09:10 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 26 May 2005 09:10:10 +0000 (09:10 +0000)
commitf0ca723e13a312cc67c9e7d00995e1a85ab031fe
tree07113bdf91c88dd3ed467c4e215cbd6f47922e7d
parent12286b8689974197e3bd2845ebb76dd59b1c48d4
Fix a bug in the serializer's race detection code.  It is possible for
the lock to be acquired and released by an interrupt between our attempt
to acquire and our tsleep.  We must test the condition again from within
a critical section before sleeping.

The previous code was doing a test-and-set when it should have just done
a test in the re-test case.
sys/cpu/i386/include/atomic.h
sys/i386/include/atomic.h
sys/kern/lwkt_serialize.c