MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / ReleaseAndWaitForChildProcess

Function ReleaseAndWaitForChildProcess

test/error.cc:28–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void ReleaseAndWaitForChildProcess(const CallbackInfo& info,
29 const uint32_t index) {
30 if (info.Length() < index + 1) {
31 return;
32 }
33
34 if (!info[index].As<Boolean>().Value()) {
35 return;
36 }
37
38 promise_for_worker_thread_.set_value();
39
40 std::future<void> future = promise_for_child_process_.get_future();
41
42 std::future_status status = future.wait_for(std::chrono::seconds(5));
43
44 if (status != std::future_status::ready) {
45 Error::Fatal("ReleaseAndWaitForChildProcess",
46 "status != std::future_status::ready");
47 }
48}
49
50void ReleaseWorkerThread(const CallbackInfo&) {
51 promise_for_child_process_.set_value();

Callers 12

ThrowJSErrorFunction · 0.85
ThrowTypeErrorCtorFunction · 0.85
ThrowTypeErrorFunction · 0.85
ThrowTypeErrorCStrFunction · 0.85
ThrowRangeErrorCStrFunction · 0.85
ThrowRangeErrorCtorFunction · 0.85
ThrowEmptyRangeErrorFunction · 0.85
ThrowRangeErrorFunction · 0.85
ThrowSyntaxErrorCStrFunction · 0.85
ThrowSyntaxErrorCtorFunction · 0.85
ThrowSyntaxErrorFunction · 0.85
ThrowDefaultErrorFunction · 0.85

Calls 2

LengthMethod · 0.80
ValueMethod · 0.80

Tested by

no test coverage detected