From d7bc4e2f014c2340295dbffade1be6c138a74c62 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 5 Jul 2020 18:55:15 +0300 Subject: [PATCH] Always reset wait descriptor owner when awakening --- sys/wait.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/wait.c b/sys/wait.c index 5f7525a..d28157b 100644 --- a/sys/wait.c +++ b/sys/wait.c @@ -34,10 +34,11 @@ int thread_wait_io(struct thread *t, struct io_notify *n) { sched_unqueue(t, THREAD_WAITING); + n->owner = NULL; + // Check if we were interrupted during io wait int r = thread_check_signal(t, 0); if (r != 0) { - n->owner = NULL; return r; } }