doc: Add information about shutdown_cb

Fixes GH 1539

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I5256a53c619b13951382fcc0439a157aa29b61aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7859
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Maciej Szwed 2021-05-12 11:22:31 +02:00 committed by Tomasz Zawadzki
parent 5cc565999e
commit 3703ebc710

View File

@ -73,3 +73,11 @@ spdk_app_start() is called, it will block the current thread until the applicati
terminates by calling spdk_app_stop() or an error condition occurs during the
initialization code within spdk_app_start(), itself, before invoking the caller's
supplied function.
## Custom shutdown callback {#event_component_shutdown}
When creating SPDK based application user may add custom shutdown callback which
will be called before the application framework starts the shutdown process.
To do that set shutdown_cb function callback in spdk_app_opts structure passed
to spdk_app_start(). Custom shutdown callback should call spdk_app_stop() before
returning to continue application shutdown process.