Skip to content

Commit 6adcb00

Browse files
committed
Add documentation on callback requirements
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 6cecaa3 commit 6adcb00

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

include/loader/ze_loader.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ typedef void (*zel_application_teardown_callback_t)(uint32_t index);
104104
* when the loader is being torn down. The loader will also provide its own callback function
105105
* and assign an index to the registered callback.
106106
*
107+
* The application_callback is required to be a function that takes no arguments and returns void.
108+
* In addition, the application_callback should be thread-safe and not block to prevent deadlocking the
109+
* loader teardown process.
110+
*
111+
* For example, the application_callback used by the static loader is:
112+
* void staticLoaderTeardownCallback() {
113+
* loaderTeardownCallbackReceived = true;
114+
* }
115+
* The application_callback should provide a simple notification to the application that the loader is being torn down.
116+
*
107117
* @param[in] application_callback Application's callback function to be called during loader teardown.
108118
* @param[out] loader_callback Pointer to the loader's callback function.
109119
* @param[out] index Index assigned to the registered callback.

0 commit comments

Comments
 (0)