napi_get_threadsafe_function_context


NAPI_EXTERN napi_status
napi_get_threadsafe_function_context(napi_threadsafe_function func,
                                     void** result); 
  • [in] func:要获取其上下文的线程安全函数。
  • [out] result:存放上下文的位置。

这个 API 可以从任何使用 func 的线程调用。

【This API may be called from any thread which makes use of func.】