1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +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:
Andreas Kling 2019-02-05 08:32:32 +01:00
parent ca16d9d98e
commit 0c38a4c30f
4 changed files with 25 additions and 6 deletions

View file

@ -5,6 +5,8 @@
#include <AK/AKString.h>
#include <AK/InlineLinkedList.h>
#include <AK/Lock.h>
#include <AK/Badge.h>
#include <Kernel/Process.h>
#include "WSMessageReceiver.h"
class Process;
@ -45,6 +47,8 @@ public:
void set_global_cursor_tracking_enabled(bool);
bool global_cursor_tracking() const { return m_global_cursor_tracking_enabled; }
void notify_process_died(Badge<Process>);
// For InlineLinkedList.
// FIXME: Maybe make a ListHashSet and then WSWindowManager can just use that.
WSWindow* m_next { nullptr };
@ -58,7 +62,7 @@ private:
bool m_global_cursor_tracking_enabled { false };
RetainPtr<GraphicsBitmap> m_backing;
Process& m_process;
Process* m_process { nullptr };
int m_window_id { -1 };
pid_t m_pid { -1 };
};