MCPcopy Create free account
hub / github.com/3rdparty/libprocess / run

Function run

include/process/run.hpp:55–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54template <typename R>
55Future<R> run(R (*method)())
56{
57 std::shared_ptr<lambda::function<R()>> thunk(
58 new lambda::function<R()>(
59 lambda::bind(method)));
60
61 std::shared_ptr<Promise<R>> promise(new Promise<R>());
62 Future<R> future = promise->future();
63
64 terminate(spawn(new internal::ThunkProcess<R>(thunk, promise), true));
65
66 return future;
67}
68
69
70#define TEMPLATE(Z, N, DATA) \

Callers 3

startMethod · 0.70
runMethod · 0.50
TEST_FFunction · 0.50

Calls 4

bindFunction · 0.85
futureMethod · 0.80
terminateFunction · 0.70
spawnFunction · 0.70

Tested by 2

runMethod · 0.40
TEST_FFunction · 0.40