Skip to content

Commit 1b28022

Browse files
committed
doc: clarify operation of napi_cancel_async_work
PR-URL: #12974 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
1 parent e600fbe commit 1b28022

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/n-api.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2931,11 +2931,12 @@ NAPI_EXTERN napi_status napi_cancel_async_work(napi_env env,
29312931

29322932
Returns `napi_ok` if the API succeeded.
29332933

2934-
This API cancels a previously allocated work, provided
2935-
it has not yet been queued for execution. After this function is called
2934+
This API cancels queued work if it has not yet
2935+
been started. If it has already started executing, it cannot be
2936+
cancelled and `napi_generic_failure` will be returned. If successful,
29362937
the `complete` callback will be invoked with a status value of
29372938
`napi_cancelled`. The work should not be deleted before the `complete`
2938-
callback invocation, even when it was cancelled.
2939+
callback invocation, even if it has been successfully cancelled.
29392940

29402941

29412942
[Aynchronous Operations]: #n_api_asynchronous_operations

0 commit comments

Comments
 (0)