summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-09-01 07:15:23 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-09-01 07:15:23 +0000
commite2e057b4a2bc0953fc88104d85d48f3007646297 (patch)
tree3e80de41fc38405baa24812e0a01f8a5858813f2
parent4cdd229f839bfe3bc96c4c0844d1d5e3fbc6cacf (diff)
Notes
-rw-r--r--sys/kern/kern_umtx.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 51495aa23ff5..ae2dfcd52ec2 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -2609,7 +2609,7 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, struct _umtx
uint32_t flags, wrflags;
int32_t state, oldstate;
int32_t blocked_readers;
- int error, rv;
+ int error, error1, rv;
uq = td->td_umtxq;
error = fueword32(&rwlock->rw_flags, &flags);
@@ -2758,9 +2758,12 @@ sleep:
if (oldstate == state)
break;
state = oldstate;
- error = umtxq_check_susp(td);
- if (error != 0)
+ error1 = umtxq_check_susp(td);
+ if (error1 != 0) {
+ if (error == 0)
+ error = error1;
break;
+ }
}
}
@@ -2783,7 +2786,7 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock, struct _umtx_time *timeo
int32_t state, oldstate;
int32_t blocked_writers;
int32_t blocked_readers;
- int error, rv;
+ int error, error1, rv;
uq = td->td_umtxq;
error = fueword32(&rwlock->rw_flags, &flags);
@@ -2929,14 +2932,17 @@ sleep:
if (oldstate == state)
break;
state = oldstate;
- error = umtxq_check_susp(td);
+ error1 = umtxq_check_susp(td);
/*
* We are leaving the URWLOCK_WRITE_WAITERS
* behind, but this should not harm the
* correctness.
*/
- if (error != 0)
+ if (error1 != 0) {
+ if (error == 0)
+ error = error1;
break;
+ }
}
rv = fueword32(&rwlock->rw_blocked_readers,
&blocked_readers);