mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
Kernel: Fix a few Thread::block related races
We need to have a Thread lock to protect threading related operations, such as Thread::m_blocker which is used in Thread::block. Also, if a Thread::Blocker indicates that it should be unblocking immediately, don't actually block the Thread and instead return immediately in Thread::block.
This commit is contained in:
parent
df3c8267d4
commit
c813bb7355
Notes:
sideshowbarker
2024-07-19 04:21:30 +09:00
Author: https://github.com/tomuta
Commit: c813bb7355
Pull-request: https://github.com/SerenityOS/serenity/pull/2973
Reviewed-by: https://github.com/awesomekling
7 changed files with 109 additions and 46 deletions
|
@ -498,7 +498,7 @@ KResult Plan9FS::read_and_dispatch_one_message()
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
bool Plan9FS::Blocker::should_unblock(Thread&, time_t, long)
|
||||
bool Plan9FS::Blocker::should_unblock(Thread&)
|
||||
{
|
||||
if (m_completion.completed)
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue