summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-11 12:37:51 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-12 01:18:27 +0200
commitf753d1d50f0cd478b0980b60d1392f12e93788b6 (patch)
treedb3c5f5e025438a7f64916410da44f842713322c /kern
parentc12d46e09a9600f71d87be4c037b3eaad2e995f6 (diff)
lock: Reset l->writer also for read-write upgradees which are done
Diffstat (limited to 'kern')
-rw-r--r--kern/lock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kern/lock.c b/kern/lock.c
index 43281147..2b86fef8 100644
--- a/kern/lock.c
+++ b/kern/lock.c
@@ -340,9 +340,12 @@ void lock_done(
if (l->recursion_depth != 0)
l->recursion_depth--;
else
- if (l->want_upgrade)
+ if (l->want_upgrade) {
l->want_upgrade = FALSE;
- else {
+#if MACH_LDEBUG
+ l->writer = THREAD_NULL;
+#endif /* MACH_LDEBUG */
+ } else {
l->want_write = FALSE;
#if MACH_LDEBUG
l->writer = THREAD_NULL;