mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 09:35:48 +00:00
24fe8b7e92
Reviewed By: mhorowitz Differential Revision: D3237829 fb-gh-sync-id: 348c7d1e2810400c1259e3d99c2d026da4a39816 fbshipit-source-id: 348c7d1e2810400c1259e3d99c2d026da4a39816
24 lines
610 B
C++
24 lines
610 B
C++
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include <condition_variable>
|
|
#include <functional>
|
|
#include <mutex>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class MessageQueueThread {
|
|
public:
|
|
virtual ~MessageQueueThread() {}
|
|
virtual void runOnQueue(std::function<void()>&&) = 0;
|
|
// runOnQueueSync and quitSynchronous are dangerous. They should only be
|
|
// used for initialization and cleanup.
|
|
virtual void runOnQueueSync(std::function<void()>&&) = 0;
|
|
// Once quitSynchronous() returns, no further work should run on the queue.
|
|
virtual void quitSynchronous() = 0;
|
|
};
|
|
|
|
}}
|