// This is analogous to dispatch_async void RCTMessageThread::runAsync(std::function<void()> func) { CFRunLoopPerformBlock(m_cfRunLoop, kCFRunLoopCommonModes, ^{ func(); }); CFRunLoopWakeUp(m_cfRunLoop); }
// This is analogous to dispatch_sync void RCTMessageThread::runSync(std::function<void()> func) { if (m_cfRunLoop == CFRunLoopGetCurrent()) { func(); return; }