Create JS executor and context on main thread w/ custom JSC

Reviewed By: javache

Differential Revision: D5165405

fbshipit-source-id: 35e5cfdf0518968c095ba54ec980d2fe376fa20e
This commit is contained in:
Dan Caspi 2017-06-06 04:37:11 -07:00 committed by Facebook Github Bot
parent e5e3591009
commit e284a9db8c
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@ class RCTMessageThread : public MessageQueueThread {
void runOnQueue(std::function<void()>&&) override; void runOnQueue(std::function<void()>&&) override;
void runOnQueueSync(std::function<void()>&&) override; void runOnQueueSync(std::function<void()>&&) override;
void quitSynchronous() override; void quitSynchronous() override;
void setRunLoop(NSRunLoop *runLoop);
private: private:
void tryFunc(const std::function<void()>& func); void tryFunc(const std::function<void()>& func);

View File

@ -94,5 +94,11 @@ void RCTMessageThread::quitSynchronous() {
CFRunLoopStop(m_cfRunLoop); CFRunLoopStop(m_cfRunLoop);
} }
void RCTMessageThread::setRunLoop(NSRunLoop *runLoop) {
CFRelease(m_cfRunLoop);
m_cfRunLoop = [runLoop getCFRunLoop];
CFRetain(m_cfRunLoop);
}
} }
} }