diff options
author | Tom <tomut@yahoo.com> | 2020-12-07 21:29:41 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-12 21:28:12 +0100 |
commit | da5cc34ebbdfcc5b37815d369fe0c0931df54c90 (patch) | |
tree | 21b1bf721a5dce58a0ea652cee8d05d74884f002 /Kernel/Devices/AsyncDeviceRequest.cpp | |
parent | 0918d8b1f8bae11a2ef97c79564a7e7c9a394eb5 (diff) | |
download | serenity-da5cc34ebbdfcc5b37815d369fe0c0931df54c90.zip |
Kernel: Fix some issues related to fixes and block conditions
Fix some problems with join blocks where the joining thread block
condition was added twice, which lead to a crash when trying to
unblock that condition a second time.
Deferred block condition evaluation by File objects were also not
properly keeping the File object alive, which lead to some random
crashes and corruption problems.
Other problems were caused by the fact that the Queued state didn't
handle signals/interruptions consistently. To solve these issues we
remove this state entirely, along with Thread::wait_on and change
the WaitQueue into a BlockCondition instead.
Also, deliver signals even if there isn't going to be a context switch
to another thread.
Fixes #4336 and #4330
Diffstat (limited to 'Kernel/Devices/AsyncDeviceRequest.cpp')
-rw-r--r-- | Kernel/Devices/AsyncDeviceRequest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Devices/AsyncDeviceRequest.cpp b/Kernel/Devices/AsyncDeviceRequest.cpp index 7f354b141a..29112bcfe5 100644 --- a/Kernel/Devices/AsyncDeviceRequest.cpp +++ b/Kernel/Devices/AsyncDeviceRequest.cpp @@ -74,7 +74,7 @@ auto AsyncDeviceRequest::wait(timeval* timeout) -> RequestWaitResult auto request_result = get_request_result(); if (is_completed_result(request_result)) return { request_result, Thread::BlockResult::NotBlocked }; - auto wait_result = Thread::current()->wait_on(m_queue, name(), Thread::BlockTimeout(false, timeout)); + auto wait_result = m_queue.wait_on(Thread::BlockTimeout(false, timeout), name()); return { get_request_result(), wait_result }; } |