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

Method Execute

test/async_progress_worker.cc:244–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243 protected:
244 void Execute(const ExecutionProgress& progress) override {
245 {
246 std::unique_lock<std::mutex> lock(_cvm);
247 // Testing a nullptr send is acceptable.
248 progress.Send(nullptr, 0);
249 _cv.wait(lock, [this] { return _test_case_count == 1; });
250 }
251 {
252 std::unique_lock<std::mutex> lock(_cvm);
253 progress.Signal();
254 _cv.wait(lock, [this] { return _test_case_count == 2; });
255 }
256 // Testing busy looping on send doesn't trigger unexpected empty data
257 // OnProgress call.
258 for (size_t i = 0; i < 1000000; i++) {
259 ProgressData data{0};
260 progress.Send(&data, 1);
261 }
262 }
263
264 void OnProgress(const ProgressData* /* data */, size_t count) override {
265 Napi::Env env = Env();

Callers

nothing calls this directly

Calls 2

SendMethod · 0.80
SignalMethod · 0.80

Tested by

no test coverage detected