mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-31 12:54:11 +00:00
Kernel: Fix ASSERTION failed in join_thread syscall
set_interrupted_by_death was never called whenever a thread that had a joiner died, so the joiner remained with the joinee pointer there, resulting in an assertion fail in JoinBlocker: m_joinee pointed to a freed task, filled with garbage. Thread::current->m_joinee may not be valid after the unblock Properly return the joinee exit value to the joiner thread.
This commit is contained in:
committed by
Andreas Kling
parent
d28fa89346
commit
05ce8586ea
@@ -300,6 +300,7 @@ void Thread::finalize()
|
||||
if (m_joiner) {
|
||||
ASSERT(m_joiner->m_joinee == this);
|
||||
static_cast<JoinBlocker*>(m_joiner->m_blocker)->set_joinee_exit_value(m_exit_value);
|
||||
static_cast<JoinBlocker*>(m_joiner->m_blocker)->set_interrupted_by_death();
|
||||
m_joiner->m_joinee = nullptr;
|
||||
// NOTE: We clear the joiner pointer here as well, to be tidy.
|
||||
m_joiner = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user