summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqenqueue.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-16 16:39:43 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-23 12:52:06 +0100
commit125f248231c173a038ed9fc00832e0b3d221ad43 (patch)
tree3894553badc7582b0c460aec4d34955f23ea3e81 /cpukit/score/src/threadqenqueue.c
parentscore: Robust thread dispatch (diff)
downloadrtems-125f248231c173a038ed9fc00832e0b3d221ad43.tar.bz2
score: Add thread queue enqueue callout
Replace the expected thread dispatch disable level with a thread queue enqueue callout. This enables the use of _Thread_Dispatch_direct() in the thread queue enqueue procedure. This avoids impossible exection paths, e.g. Per_CPU_Control::dispatch_necessary is always true.
Diffstat (limited to 'cpukit/score/src/threadqenqueue.c')
-rw-r--r--cpukit/score/src/threadqenqueue.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 84d1765462..ce0e80c6f2 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -356,6 +356,15 @@ bool _Thread_queue_Path_acquire_critical(
return true;
}
+void _Thread_queue_Enqueue_do_nothing(
+ Thread_queue_Queue *queue,
+ Thread_Control *the_thread,
+ Thread_queue_Context *queue_context
+)
+{
+ /* Do nothing */
+}
+
void _Thread_queue_Deadlock_status( Thread_Control *the_thread )
{
the_thread->Wait.return_code = STATUS_DEADLOCK;
@@ -442,16 +451,7 @@ void _Thread_queue_Enqueue_critical(
);
_Thread_queue_Queue_release( queue, &queue_context->Lock_context.Lock_context );
- if (
- cpu_self->thread_dispatch_disable_level
- != queue_context->expected_thread_dispatch_disable_level
- ) {
- _Terminate(
- INTERNAL_ERROR_CORE,
- false,
- INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_FROM_BAD_STATE
- );
- }
+ ( *queue_context->enqueue_callout )( queue, the_thread, queue_context );
/*
* Set the blocking state for this thread queue in the thread.
@@ -482,7 +482,7 @@ void _Thread_queue_Enqueue_critical(
}
_Thread_Priority_update( queue_context );
- _Thread_Dispatch_enable( cpu_self );
+ _Thread_Dispatch_direct( cpu_self );
}
#if defined(RTEMS_SMP)