mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
Kernel: Fix error propagation if Thread::WaitBlocker constructor fails
There is logic at the end of the constructor that sets m_should_block to false if we encountered errors. We were missing this step due to the erroneous early return, the code then ended up waiting and then asserting on unblock since the WaitBlocker is in a invalid state. This fix is to not return early, and let normal control flow handle it. Fixes: #7857 Verified with `stress-ng --yield=10` locally.
This commit is contained in:
parent
9fccbde371
commit
77f4f6e0de
Notes:
sideshowbarker
2024-07-18 12:43:26 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/77f4f6e0dea Pull-request: https://github.com/SerenityOS/serenity/pull/7860 Issue: https://github.com/SerenityOS/serenity/issues/7857
|
@ -599,7 +599,6 @@ Thread::WaitBlocker::WaitBlocker(int wait_options, idtype_t id_type, pid_t id, K
|
|||
if (!m_waitee || m_waitee->ppid() != Process::current()->pid()) {
|
||||
m_result = ECHILD;
|
||||
m_error = true;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -608,7 +607,6 @@ Thread::WaitBlocker::WaitBlocker(int wait_options, idtype_t id_type, pid_t id, K
|
|||
if (!m_waitee_group) {
|
||||
m_result = ECHILD;
|
||||
m_error = true;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue