napi_unref_threadsafe_function
NAPI_EXTERN napi_status
napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func);
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[in] func
:要取消引用的线程安全函数。¥
[in] func
: The thread-safe function to unreference.
该 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.