napi_release_threadsafe_function

Function napi_release_threadsafe_function 

Source
pub unsafe extern "C" fn napi_release_threadsafe_function(
    func: napi_threadsafe_function,
    mode: napi_threadsafe_function_release_mode,
) -> napi_status
Available on crate feature napi only.
Expand description

Releases a thread-safe function.

§Arguments

  • func - The created thread-safe function.

  • mode - Value of mode can be either ‘napi_tsfn_release’ to indicate that no more calls should be made to the thread-safe function from current thread or ‘napi_tsfn_abort’ to indicate that the queue of the thread-safe function will be closed and ‘napi_closing’ will be return when calling ‘napi_call_threadsafe_function()’ under the circumstance.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If func is nullptr.

[napi_generic_failure] If release thread-safe function failed.

Available since API-level: 10