From 72cdd6ef995d01b36fd6cd79ec1a88472ea5a5c0 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 8 Jun 2010 16:17:47 +0000 Subject: 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 --- sys/kern/kern_sx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 37e5d03..35ee91c 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -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; -- cgit v1.1