From 843f8a6224fb3033c01009a73aecae514b1e1c36 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Wed, 7 Oct 2015 14:26:18 -0400 Subject: [PATCH] doc: Add documentation for sys_thread_busy_wait() Change-Id: I71f405448f141ae02c28889afd3fc03ddef55ecd Signed-off-by: Allan Stephens --- doc/kernel/common/common_contexts.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/kernel/common/common_contexts.rst b/doc/kernel/common/common_contexts.rst index 88de73cc881..1e37a881e26 100644 --- a/doc/kernel/common/common_contexts.rst +++ b/doc/kernel/common/common_contexts.rst @@ -20,6 +20,11 @@ task or fiber is zero. The custom data value is not available to ISRs, which operate in the shared kernel interrupt handling context. +The kernel allows a task or fiber to delay its processing for a specified time +period by performing a busy wait. This allows the delay to occur without +requiring the kernel to perform the context switching that occurs with its +more typical timer and timeout services. + Purpose ******* @@ -27,6 +32,11 @@ Purpose Use the kernel execution context services when writing code that needs to operate differently when executed by different contexts. +Use the busy wait service when the required delay is too short to warrant +context switching to another task or fiber, or when performing a delay +as part of the nanokernel's background task (which is not allowed to +volutarily relinquish the CPU). + Usage ***** @@ -92,3 +102,6 @@ The following kernel execution context APIs are provided by | :c:func:`sys_thread_custom_data_get()` | Reads custom data for currently | | | executing task or fiber. | +--------------------------------------------+---------------------------------------+ +| :c:func:`sys_thread_busy_wait()` | Performs a busy wait for the | +| | specified time period. | ++--------------------------------------------+---------------------------------------+