Sitelet https://github.com/microsoft/arcana.cpp/commit/fe473c9dcb74156466658d93445bc13f94d2168e
Skip to content

Commit fe473c9

Browse files
authored
Fix issues with run_loop_scheduler
Use kCFRunLoopCommonModes instead of kCFRunLoopDefaultMode, and call CFRunLoopWakeUp to tell the run loop it needs to process.
1 parent 799216c commit fe473c9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Source/Apple/arcana/threading/task_schedulers.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ namespace arcana
4343
void operator()(CallableT&& callable) const
4444
{
4545
CallableT _callable{ std::forward<CallableT>(callable) };
46-
CFRunLoopPerformBlock(m_runLoop, kCFRunLoopDefaultMode, ^{
46+
CFRunLoopPerformBlock(m_runLoop, kCFRunLoopCommonModes, ^{
4747
_callable();
4848
});
49+
50+
// In case the run loop is idle, we need to wake it up and drain the queue
51+
CFRunLoopWakeUp(m_runLoop);
4952
}
5053

5154
static run_loop_scheduler get_for_current_thread()

0 commit comments

Comments
 (0)