| 26 | } |
| 27 | |
| 28 | void 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 | |
| 50 | void ReleaseWorkerThread(const CallbackInfo&) { |
| 51 | promise_for_child_process_.set_value(); |
no test coverage detected