summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqenqueue.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-29 12:06:55 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-29 12:06:55 +0200
commit16832b0d9e1f6448a57b6f5f2909cff7ad360706 (patch)
tree772708cb85a765b1a3c5b0437a14027c581b7e28 /cpukit/score/src/threadqenqueue.c
parentscore: Allow MPCI packet receive function to block (diff)
downloadrtems-16832b0d9e1f6448a57b6f5f2909cff7ad360706.tar.bz2
score: Fix multiprocessing thread proxies
We must provide thread queue heads for the thread wait information for each thread proxy (thread queue heads were introduced by d7665823b208daefb6855591d808e1f3075cedcb). The thread proxy must be allocated before the enqueue operation.
Diffstat (limited to 'cpukit/score/src/threadqenqueue.c')
-rw-r--r--cpukit/score/src/threadqenqueue.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index e7751359d7..803b5568b3 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -58,6 +58,12 @@ void _Thread_queue_Enqueue_critical(
Per_CPU_Control *cpu_self;
bool success;
+#if defined(RTEMS_MULTIPROCESSING)
+ if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet ) {
+ the_thread = _Thread_MP_Allocate_proxy( state );
+ }
+#endif
+
_Thread_Lock_set( the_thread, &queue->Lock );
_Thread_Wait_set_queue( the_thread, queue );
@@ -69,11 +75,6 @@ void _Thread_queue_Enqueue_critical(
cpu_self = _Thread_Dispatch_disable_critical( lock_context );
_Thread_queue_Queue_release( queue, lock_context );
-#if defined(RTEMS_MULTIPROCESSING)
- if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet )
- the_thread = _Thread_MP_Allocate_proxy( state );
- else
-#endif
/*
* Set the blocking state for this thread queue in the thread.
*/