From d78d5294cd076b48160e12c2f52a940d783b4dac Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 Nov 2016 09:11:07 +0100 Subject: score: Add and use _Thread_Dispatch_direct() This function is useful for operations which synchronously block, e.g. self restart, self deletion, yield, sleep. It helps to detect if these operations are called in the wrong context. Since the thread dispatch necessary indicator is not used, this is more robust in some SMP situations. Update #2751. --- cpukit/score/include/rtems/score/threaddispatch.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cpukit/score/include/rtems/score/threaddispatch.h') diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h index 801970ab21..f4ca096783 100644 --- a/cpukit/score/include/rtems/score/threaddispatch.h +++ b/cpukit/score/include/rtems/score/threaddispatch.h @@ -94,6 +94,20 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) */ void _Thread_Dispatch( void ); +/** + * @brief Directly do a thread dispatch. + * + * Must be called with a thread dispatch disable level of one, otherwise the + * INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL will occur. This function + * is useful for operations which synchronously block, e.g. self restart, self + * deletion, yield, sleep. + * + * @param[in] cpu_self The current processor. + * + * @see _Thread_Dispatch(). + */ +void _Thread_Dispatch_direct( Per_CPU_Control *cpu_self ); + /** * @brief Performs a thread dispatch on the current processor. * -- cgit v1.2.3