1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 02:08:11 +00:00

Paper over a race in DoubleBuffer.

I'm still somewhat okay throwing InterruptDisabler at races as they screw me.
Eventually I'm gonna have to devise a different strategy though.
This commit is contained in:
Andreas Kling 2019-01-12 23:23:35 +01:00
parent 2e2d883c09
commit 3ac977f50b
4 changed files with 20 additions and 4 deletions

View file

@ -36,7 +36,11 @@ int EventLoop::exec()
for (;;) {
if (m_queuedEvents.is_empty())
waitForEvent();
auto events = move(m_queuedEvents);
Vector<QueuedEvent> events;
{
InterruptDisabler disabler;
events = move(m_queuedEvents);
}
for (auto& queuedEvent : events) {
auto* receiver = queuedEvent.receiver;
auto& event = *queuedEvent.event;