From e284a9db8cd32cb9a1baad599193a6ab78546c99 Mon Sep 17 00:00:00 2001 From: Dan Caspi Date: Tue, 6 Jun 2017 04:37:11 -0700 Subject: [PATCH] Create JS executor and context on main thread w/ custom JSC Reviewed By: javache Differential Revision: D5165405 fbshipit-source-id: 35e5cfdf0518968c095ba54ec980d2fe376fa20e --- React/CxxBridge/RCTMessageThread.h | 1 + React/CxxBridge/RCTMessageThread.mm | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/React/CxxBridge/RCTMessageThread.h b/React/CxxBridge/RCTMessageThread.h index c8a26737e..e4b83912e 100644 --- a/React/CxxBridge/RCTMessageThread.h +++ b/React/CxxBridge/RCTMessageThread.h @@ -24,6 +24,7 @@ class RCTMessageThread : public MessageQueueThread { void runOnQueue(std::function&&) override; void runOnQueueSync(std::function&&) override; void quitSynchronous() override; + void setRunLoop(NSRunLoop *runLoop); private: void tryFunc(const std::function& func); diff --git a/React/CxxBridge/RCTMessageThread.mm b/React/CxxBridge/RCTMessageThread.mm index 409c003b3..e3b85ff90 100644 --- a/React/CxxBridge/RCTMessageThread.mm +++ b/React/CxxBridge/RCTMessageThread.mm @@ -94,5 +94,11 @@ void RCTMessageThread::quitSynchronous() { CFRunLoopStop(m_cfRunLoop); } +void RCTMessageThread::setRunLoop(NSRunLoop *runLoop) { + CFRelease(m_cfRunLoop); + m_cfRunLoop = [runLoop getCFRunLoop]; + CFRetain(m_cfRunLoop); +} + } }