diff options
author | jhb <jhb@FreeBSD.org> | 2010-06-08 16:17:47 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-06-08 16:17:47 +0000 |
commit | 72cdd6ef995d01b36fd6cd79ec1a88472ea5a5c0 (patch) | |
tree | acad9616f3811cb017ff955ef2b239007355ef55 /sys/kern | |
parent | dcb98911e2e5ea29226094837697a14d867cecf8 (diff) | |
download | FreeBSD-src-72cdd6ef995d01b36fd6cd79ec1a88472ea5a5c0.zip FreeBSD-src-72cdd6ef995d01b36fd6cd79ec1a88472ea5a5c0.tar.gz |
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
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sx.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |