WindowServer: Remove "unsafe" flag in WSMessageLoop::post_event().

This hack is no longer needed now that we have a Finalizer process that can
take locks without having to worry about the interrupt flag.
This commit is contained in:
Andreas Kling 2019-02-11 13:05:51 +01:00
parent f7b25773ab
commit 26230c0647
Notes: sideshowbarker 2024-07-19 15:47:21 +09:00
3 changed files with 4 additions and 13 deletions

View file

@ -77,7 +77,7 @@ int Process::gui$destroy_window(int window_id)
if (it == m_windows.end())
return -EBADWINDOW;
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
WSMessageLoop::the().post_message((*it).value.leak_ptr(), move(message), true);
WSMessageLoop::the().post_message((*it).value.leak_ptr(), move(message));
m_windows.remove(window_id);
return 0;
}
@ -258,12 +258,10 @@ int Process::gui$set_global_cursor_tracking_enabled(int window_id, bool enabled)
void Process::destroy_all_windows()
{
InterruptFlagSaver saver;
sti();
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);
WSMessageLoop::the().post_message(it.value.leak_ptr(), move(message));
}
m_windows.clear();
}

View file

@ -67,15 +67,8 @@ int WSMessageLoop::exec()
}
}
void WSMessageLoop::post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&& message, bool unsafe)
void WSMessageLoop::post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&& message)
{
if (unsafe) {
// FIXME: This is such a hack. It should not exist.
m_queued_messages.append({ receiver, move(message) });
if (current != m_server_process)
m_server_process->request_wakeup();
return;
}
LOCKER(m_lock);
#ifdef WSEVENTLOOP_DEBUG
dbgprintf("WSMessageLoop::post_message: {%u} << receiver=%p, message=%p\n", m_queued_messages.size(), receiver, message.ptr());

View file

@ -15,7 +15,7 @@ public:
int exec();
void post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&&, bool unsafe = false);
void post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&&);
static WSMessageLoop& the();