mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 01:47:34 +00:00
WindowServer: Sever the WSWindow/Process link when the process dies.
This fixes a deadlock where the WindowServer would get stuck trying to acquire a dead process's event stream lock.
This commit is contained in:
parent
ca16d9d98e
commit
0c38a4c30f
4 changed files with 25 additions and 6 deletions
|
@ -264,6 +264,7 @@ void Process::destroy_all_windows()
|
|||
{
|
||||
for (auto& it : m_windows) {
|
||||
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
|
||||
it.value->notify_process_died(Badge<Process>());
|
||||
WSMessageLoop::the().post_message(it.value.leak_ptr(), move(message), true);
|
||||
}
|
||||
m_windows.clear();
|
||||
|
|
|
@ -236,7 +236,10 @@ bool Scheduler::context_switch(Process& process)
|
|||
current->set_state(Process::Runnable);
|
||||
|
||||
#ifdef LOG_EVERY_CONTEXT_SWITCH
|
||||
dbgprintf("Scheduler: %s(%u) -> %s(%u)\n", current->name().characters(), current->pid(), process.name().characters(), process.pid());
|
||||
dbgprintf("Scheduler: %s(%u) -> %s(%u) %w:%x\n",
|
||||
current->name().characters(), current->pid(),
|
||||
process.name().characters(), process.pid(),
|
||||
process.tss().cs, process.tss().eip);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue