kernel: add fiber_wakeup()
Like for the other context-specific APIs, also provide a context-agnostic wrapper. Change-Id: Icf0a62f4c06aec42f0febc298edbd8bdeec63749 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
7a613adc14
commit
fcfb4b6bda
2 changed files with 25 additions and 0 deletions
|
@ -280,6 +280,20 @@ extern void fiber_fiber_wakeup(nano_thread_id_t fiber);
|
|||
*/
|
||||
extern void task_fiber_wakeup(nano_thread_id_t fiber);
|
||||
|
||||
/**
|
||||
* @brief Wake the specified fiber from sleep
|
||||
*
|
||||
* This routine is a convenience wrapper for the execution of context-specific
|
||||
* APIs. It is helpful when the exact execution context is not known. However,
|
||||
* it should be avoided when the context is known up-front to avoid
|
||||
* unnecessary overhead.
|
||||
*
|
||||
* @param fiber Identifies fiber to wake
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
extern void fiber_wakeup(nano_thread_id_t fiber);
|
||||
|
||||
#ifndef CONFIG_MICROKERNEL
|
||||
/**
|
||||
* @brief Put the task to sleep.
|
||||
|
|
|
@ -69,6 +69,17 @@ void task_fiber_wakeup(nano_thread_id_t fiber)
|
|||
}
|
||||
}
|
||||
|
||||
void fiber_wakeup(nano_thread_id_t fiber)
|
||||
{
|
||||
static void (*func[3])(nano_thread_id_t) = {
|
||||
isr_fiber_wakeup,
|
||||
fiber_fiber_wakeup,
|
||||
task_fiber_wakeup
|
||||
};
|
||||
|
||||
func[sys_execution_context_type_get()](fiber);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_MICROKERNEL
|
||||
void task_sleep(int32_t timeout_in_ticks)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue