Skip to content

Commit 8b1a016

Browse files
philIipfacebook-github-bot
authored andcommitted
remove unused functions from RuntimeExecutor.h (facebook#44197)
Summary: Pull Request resolved: facebook#44197 Changelog: [General][Breaking] Remove executeAsynchronously and executeSynchronously_CAN_DEADLOCK these are not used anywhere nor in OSS, we can delete this safely Reviewed By: javache Differential Revision: D56447959 fbshipit-source-id: d66c10f676946422385750c1b8825ead2d5d0ed8
1 parent 995d5b8 commit 8b1a016

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,6 @@ namespace facebook::react {
2525
using RuntimeExecutor =
2626
std::function<void(std::function<void(jsi::Runtime& runtime)>&& callback)>;
2727

28-
/*
29-
* The caller can expect that the callback will be executed sometime later on an
30-
* unspecified thread.
31-
* Use this method when the caller prefers to not be blocked by executing the
32-
* `callback`.
33-
* Note that this method does not provide any guarantees
34-
* about when the `callback` will be executed (before returning to the caller,
35-
* after that, or in parallel), the only thing that is guaranteed is that there
36-
* is no synchronization.
37-
*/
38-
inline static void executeAsynchronously(
39-
const RuntimeExecutor& runtimeExecutor,
40-
std::function<void(jsi::Runtime& runtime)>&& callback) noexcept {
41-
std::thread([callback = std::move(callback), runtimeExecutor]() mutable {
42-
runtimeExecutor(std::move(callback));
43-
}).detach();
44-
}
45-
46-
/*
47-
* Executes a `callback` in a *synchronous* manner using given
48-
* `RuntimeExecutor`.
49-
* Use this method when the caller needs to *be blocked* by executing the
50-
* callback but does not concerned about the particular thread on which the
51-
* `callback` will be executed.
52-
*/
53-
inline static void executeSynchronously_CAN_DEADLOCK(
54-
const RuntimeExecutor& runtimeExecutor,
55-
std::function<void(jsi::Runtime& runtime)>&& callback) noexcept {
56-
std::mutex mutex;
57-
mutex.lock();
58-
59-
runtimeExecutor(
60-
[callback = std::move(callback), &mutex](jsi::Runtime& runtime) {
61-
callback(runtime);
62-
mutex.unlock();
63-
});
64-
65-
mutex.lock();
66-
}
67-
6828
/*
6929
* Executes a `callback` in a *synchronous* manner on the same thread using
7030
* given `RuntimeExecutor`.

0 commit comments

Comments
 (0)