mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
Ladybird+MacVideoPlayer: Align post_event with other event loop impls
After cherry-picking ladybird deferred invoke changes, the macOS event loop implementations' post_event have diverged from everyone else's. It tries to post the 'deferred invoke' event, but after all the changes to how deferred invoke is dispatched, deferred invoke will never go through post_event. Restore the previous "wake if not my thread" behavior, and clean up the unused atomic variable.
This commit is contained in:
1 parent
1d3f09aaec
commit
49557c2e12
2 files changed
+4
-10
No files matched your search
@@ -210,7 +210,6 @@ struct CFEventLoopImplementation::Impl {
|
||||
context.info = &event_loop_implementation;
|
||||
context.perform = [](void* info) {
|
||||
auto& self = *static_cast<CFEventLoopImplementation*>(info);
|
||||
self.m_impl->deferred_source_pending = false;
|
||||
self.m_thread_event_queue.process();
|
||||
};
|
||||
|
||||
@@ -226,7 +225,6 @@ struct CFEventLoopImplementation::Impl {
|
||||
|
||||
CFRunLoopRef run_loop { nullptr };
|
||||
CFRunLoopSourceRef deferred_source { nullptr };
|
||||
Atomic<bool> deferred_source_pending { false };
|
||||
};
|
||||
|
||||
CFEventLoopImplementation::CFEventLoopImplementation()
|
||||
@@ -450,9 +448,8 @@ void CFEventLoopImplementation::post_event(Core::EventReceiver* receiver, Nonnul
|
||||
{
|
||||
m_thread_event_queue.post_event(receiver, move(event));
|
||||
|
||||
bool expected = false;
|
||||
if (m_impl->deferred_source && m_impl->deferred_source_pending.compare_exchange_strong(expected, true))
|
||||
CFRunLoopSourceSignal(m_impl->deferred_source);
|
||||
if (&m_thread_event_queue != &Core::ThreadEventQueue::current())
|
||||
wake();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -211,7 +211,6 @@ struct CFEventLoopImplementation::Impl {
|
||||
context.info = &event_loop_implementation;
|
||||
context.perform = [](void* info) {
|
||||
auto& self = *static_cast<CFEventLoopImplementation*>(info);
|
||||
self.m_impl->deferred_source_pending = false;
|
||||
self.m_thread_event_queue.process();
|
||||
};
|
||||
|
||||
@@ -227,7 +226,6 @@ struct CFEventLoopImplementation::Impl {
|
||||
|
||||
CFRunLoopRef run_loop { nullptr };
|
||||
CFRunLoopSourceRef deferred_source { nullptr };
|
||||
Atomic<bool> deferred_source_pending { false };
|
||||
};
|
||||
|
||||
CFEventLoopImplementation::CFEventLoopImplementation()
|
||||
@@ -451,9 +449,8 @@ void CFEventLoopImplementation::post_event(Core::EventReceiver* receiver, Nonnul
|
||||
{
|
||||
m_thread_event_queue.post_event(receiver, move(event));
|
||||
|
||||
bool expected = false;
|
||||
if (m_impl->deferred_source && m_impl->deferred_source_pending.compare_exchange_strong(expected, true))
|
||||
CFRunLoopSourceSignal(m_impl->deferred_source);
|
||||
if (&m_thread_event_queue != &Core::ThreadEventQueue::current())
|
||||
wake();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user