summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threaddispatch.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-14 09:11:07 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-18 07:30:31 +0100
commitd78d5294cd076b48160e12c2f52a940d783b4dac (patch)
tree15bdd7b4b424b6c4ab49435e71ac6c795bb5a58d /cpukit/score/src/threaddispatch.c
parentscore: Remove obsolete defines (diff)
downloadrtems-d78d5294cd076b48160e12c2f52a940d783b4dac.tar.bz2
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.
Diffstat (limited to 'cpukit/score/src/threaddispatch.c')
-rw-r--r--cpukit/score/src/threaddispatch.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c
index 36d2910ef2..c96299cb59 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -233,3 +233,19 @@ void _Thread_Dispatch( void )
_ISR_Local_enable( level );
}
}
+
+void _Thread_Dispatch_direct( Per_CPU_Control *cpu_self )
+{
+ ISR_Level level;
+
+ if ( cpu_self->thread_dispatch_disable_level != 1 ) {
+ _Terminate(
+ INTERNAL_ERROR_CORE,
+ 0,
+ INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL
+ );
+ }
+
+ _ISR_Local_disable( level );
+ _Thread_Do_dispatch( cpu_self, level );
+}