From 3703ebc71055939570ac03f1ec9009640c9124eb Mon Sep 17 00:00:00 2001 From: Maciej Szwed Date: Wed, 12 May 2021 11:22:31 +0200 Subject: [PATCH] doc: Add information about shutdown_cb Fixes GH 1539 Signed-off-by: Maciej Szwed Change-Id: I5256a53c619b13951382fcc0439a157aa29b61aa Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7859 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- doc/event.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/event.md b/doc/event.md index 657ca93e1..c0eb975e3 100644 --- a/doc/event.md +++ b/doc/event.md @@ -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.