napi_unref_threadsafe_function


NAPI_EXTERN napi_status
napi_unref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func); 
  • [in] env:调用该 API 时所处的环境。
  • [in] func:线程安全的取消引用函数。

此 API 用于指示在主线程上运行的事件循环可能在 func 被销毁之前退出。与 uv_unref 类似,它也是幂等的。

【This API is used to indicate that the event loop running on the main thread may exit before func is destroyed. Similar to uv_unref it is also idempotent.】

此 API 只能从主线程调用。

【This API may only be called from the main thread.】