Created
October 15, 2019 21:37
-
-
Save deepal/2a5ac3537ab5443d888f0a9af4736e4b to your computer and use it in GitHub Desktop.
Ref() or Unref() a worker thread
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Worker::Ref(const FunctionCallbackInfo<Value>& args) { | |
| Worker* w; | |
| ASSIGN_OR_RETURN_UNWRAP(&w, args.This()); | |
| uv_ref(reinterpret_cast<uv_handle_t*>(w->on_thread_finished_.GetHandle())); | |
| } | |
| void Worker::Unref(const FunctionCallbackInfo<Value>& args) { | |
| Worker* w; | |
| ASSIGN_OR_RETURN_UNWRAP(&w, args.This()); | |
| uv_unref(reinterpret_cast<uv_handle_t*>(w->on_thread_finished_.GetHandle())); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment