Fix a sign bug that caused adaptive spinning in sx_xlock() to not work
properly. Among other things it did not drop Giant while spinning leading to livelocks. Reviewed by: rookie, kib, jmallett MFC after: 3 days
This commit is contained in:
parent
82b361b11b
commit
8545538b6a
@ -511,7 +511,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
|
||||
* running or the state of the lock changes.
|
||||
*/
|
||||
x = sx->sx_lock;
|
||||
if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0) {
|
||||
if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) {
|
||||
if ((x & SX_LOCK_SHARED) == 0) {
|
||||
x = SX_OWNER(x);
|
||||
owner = (struct thread *)x;
|
||||
|
Loading…
x
Reference in New Issue
Block a user