summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-01 11:38:47 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 09:08:21 +0200
commit8f9658187a46f3c3ee3d7c7b68491fab5175a8fd (patch)
treec1887c2441887909201698b8d16b8cb2e8598188 /cpukit/score/src
parentscore: Simplify _Thread_queue_Do_flush() (diff)
downloadrtems-8f9658187a46f3c3ee3d7c7b68491fab5175a8fd.tar.bz2
score: Rework MP thread queue callout support
The thread queue implementation was heavily reworked to support SMP. This broke the multiprocessing support of the thread queues. This is fixed by this patch. A thread proxy is unblocked due to three reasons 1) timeout, 2) request satisfaction, and 3) extraction. In case 1) no MPCI message must be sent. This is ensured via the _Thread_queue_MP_callout_do_nothing() callout set during _Thread_MP_Allocate_proxy(). In case 2) and 3) an MPCI message must be sent. In case we interrupt the blocking operation during _Thread_queue_Enqueue_critical(), then this message must be sent by the blocking thread. For this the new fields Thread_Proxy_control::thread_queue_callout and Thread_Proxy_control::thread_queue_id are used. Delete the individual API MP callout types and use Thread_queue_MP_callout throughout. This type is only defined in multiprocessing configurations. Prefix the multiprocessing parameters with mp_ to ease code review. Multiprocessing specific parameters are optional due to use of a similar macro pattern. There is no overhead for non-multiprocessing configurations.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/apimutexunlock.c2
-rw-r--r--cpukit/score/src/condition.c4
-rw-r--r--cpukit/score/src/corebarrierrelease.c37
-rw-r--r--cpukit/score/src/corebarrierwait.c19
-rw-r--r--cpukit/score/src/coremsgbroadcast.c30
-rw-r--r--cpukit/score/src/coremsgseize.c24
-rw-r--r--cpukit/score/src/coremsgsubmit.c40
-rw-r--r--cpukit/score/src/coremutexsurrender.c46
-rw-r--r--cpukit/score/src/corerwlockrelease.c4
-rw-r--r--cpukit/score/src/futex.c4
-rw-r--r--cpukit/score/src/mutex.c6
-rw-r--r--cpukit/score/src/semaphore.c2
-rw-r--r--cpukit/score/src/threadmp.c2
-rw-r--r--cpukit/score/src/threadq.c10
-rw-r--r--cpukit/score/src/threadqenqueue.c113
-rw-r--r--cpukit/score/src/threadqflush.c7
16 files changed, 193 insertions, 157 deletions
diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c
index 04657ddcec..3545377b43 100644
--- a/cpukit/score/src/apimutexunlock.c
+++ b/cpukit/score/src/apimutexunlock.c
@@ -35,8 +35,8 @@ void _API_Mutex_Unlock( API_Mutex_Control *the_mutex )
_ISR_lock_ISR_disable( &lock_context );
_CORE_mutex_Surrender(
&the_mutex->Mutex,
- the_mutex->Object.id,
NULL,
+ 0,
&lock_context
);
diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c
index 420681955a..da3d133b49 100644
--- a/cpukit/score/src/condition.c
+++ b/cpukit/score/src/condition.c
@@ -257,7 +257,9 @@ static int _Condition_Wake( struct _Condition_Control *_condition, int count )
do_unblock = _Thread_queue_Extract_locked(
&condition->Queue.Queue,
operations,
- first
+ first,
+ NULL,
+ 0
);
if (do_unblock) {
_Chain_Append_unprotected( &unblock, &first->Wait.Node.Chain );
diff --git a/cpukit/score/src/corebarrierrelease.c b/cpukit/score/src/corebarrierrelease.c
index ba02301616..44580647bd 100644
--- a/cpukit/score/src/corebarrierrelease.c
+++ b/cpukit/score/src/corebarrierrelease.c
@@ -23,24 +23,12 @@
#include <rtems/score/objectimpl.h>
#include <rtems/score/threadqimpl.h>
-static Thread_Control *_CORE_barrier_Dequeue(
- CORE_barrier_Control *the_barrier
-)
-{
- return _Thread_queue_Dequeue(
- &the_barrier->Wait_queue,
- CORE_BARRIER_TQ_OPERATIONS
- );
-}
-
-uint32_t _CORE_barrier_Release(
- CORE_barrier_Control *the_barrier,
+uint32_t _CORE_barrier_Do_release(
+ CORE_barrier_Control *the_barrier
#if defined(RTEMS_MULTIPROCESSING)
- Objects_Id id,
- CORE_barrier_API_mp_support_callout api_barrier_mp_support
-#else
- Objects_Id id RTEMS_UNUSED,
- CORE_barrier_API_mp_support_callout api_barrier_mp_support RTEMS_UNUSED
+ ,
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id
#endif
)
{
@@ -48,11 +36,16 @@ uint32_t _CORE_barrier_Release(
uint32_t count;
count = 0;
- while ( ( the_thread = _CORE_barrier_Dequeue( the_barrier ) ) ) {
-#if defined(RTEMS_MULTIPROCESSING)
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_barrier_mp_support) ( the_thread, id );
-#endif
+ while (
+ (
+ the_thread = _Thread_queue_Dequeue(
+ &the_barrier->Wait_queue,
+ CORE_BARRIER_TQ_OPERATIONS,
+ mp_callout,
+ mp_id
+ )
+ )
+ ) {
count++;
}
the_barrier->number_of_waiting_threads = 0;
diff --git a/cpukit/score/src/corebarrierwait.c b/cpukit/score/src/corebarrierwait.c
index 52cbe74163..689ead0331 100644
--- a/cpukit/score/src/corebarrierwait.c
+++ b/cpukit/score/src/corebarrierwait.c
@@ -23,13 +23,16 @@
#include <rtems/score/statesimpl.h>
#include <rtems/score/threadqimpl.h>
-void _CORE_barrier_Wait(
- CORE_barrier_Control *the_barrier,
- Thread_Control *executing,
- Objects_Id id,
- bool wait,
- Watchdog_Interval timeout,
- CORE_barrier_API_mp_support_callout api_barrier_mp_support
+void _CORE_barrier_Do_wait(
+ CORE_barrier_Control *the_barrier,
+ Thread_Control *executing,
+ bool wait,
+ Watchdog_Interval timeout
+#if defined(RTEMS_MULTIPROCESSING)
+ ,
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id
+#endif
)
{
ISR_lock_Context lock_context;
@@ -42,7 +45,7 @@ void _CORE_barrier_Wait(
the_barrier->Attributes.maximum_count) {
executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
_Thread_queue_Release( &the_barrier->Wait_queue, &lock_context );
- _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
+ _CORE_barrier_Release( the_barrier, mp_callout, mp_id );
return;
}
}
diff --git a/cpukit/score/src/coremsgbroadcast.c b/cpukit/score/src/coremsgbroadcast.c
index 95a8650f26..9a863ffb2f 100644
--- a/cpukit/score/src/coremsgbroadcast.c
+++ b/cpukit/score/src/coremsgbroadcast.c
@@ -21,19 +21,16 @@
#include <rtems/score/coremsgimpl.h>
#include <rtems/score/objectimpl.h>
-CORE_message_queue_Status _CORE_message_queue_Broadcast(
- CORE_message_queue_Control *the_message_queue,
- const void *buffer,
- size_t size,
- #if defined(RTEMS_MULTIPROCESSING)
- Objects_Id id,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- #else
- Objects_Id id RTEMS_UNUSED,
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support RTEMS_UNUSED,
- #endif
- uint32_t *count,
- ISR_lock_Context *lock_context
+CORE_message_queue_Status _CORE_message_queue_Do_broadcast(
+ CORE_message_queue_Control *the_message_queue,
+ const void *buffer,
+ size_t size,
+#if defined(RTEMS_MULTIPROCESSING)
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id,
+#endif
+ uint32_t *count,
+ ISR_lock_Context *lock_context
)
{
Thread_Control *the_thread;
@@ -54,6 +51,8 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast(
the_message_queue,
buffer,
size,
+ mp_callout,
+ mp_id,
0,
lock_context
)
@@ -61,11 +60,6 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast(
) {
number_broadcasted += 1;
-#if defined(RTEMS_MULTIPROCESSING)
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_message_queue_mp_support) ( the_thread, id );
-#endif
-
_CORE_message_queue_Acquire( the_message_queue, lock_context );
}
diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c
index 34a3c50e47..5e14918d3a 100644
--- a/cpukit/score/src/coremsgseize.c
+++ b/cpukit/score/src/coremsgseize.c
@@ -27,14 +27,14 @@
#include <rtems/score/wkspace.h>
void _CORE_message_queue_Seize(
- CORE_message_queue_Control *the_message_queue,
- Thread_Control *executing,
- Objects_Id id,
- void *buffer,
- size_t *size_p,
- bool wait,
- Watchdog_Interval timeout,
- ISR_lock_Context *lock_context
+ CORE_message_queue_Control *the_message_queue,
+ Thread_Control *executing,
+ Objects_Id id,
+ void *buffer,
+ size_t *size_p,
+ bool wait,
+ Watchdog_Interval timeout,
+ ISR_lock_Context *lock_context
)
{
CORE_message_queue_Buffer_control *the_message;
@@ -111,11 +111,10 @@ void _CORE_message_queue_Seize(
&the_message_queue->Wait_queue.Queue,
the_message_queue->operations,
the_thread,
+ NULL,
+ 0,
lock_context
);
- #if defined(RTEMS_MULTIPROCESSING)
- _Thread_Dispatch_enable( _Per_CPU_Get() );
- #endif
return;
}
#endif
@@ -140,7 +139,4 @@ void _CORE_message_queue_Seize(
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT,
lock_context
);
- #if defined(RTEMS_MULTIPROCESSING)
- _Thread_Dispatch_enable( _Per_CPU_Get() );
- #endif
}
diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c
index 02de12f6ea..f63fa39f39 100644
--- a/cpukit/score/src/coremsgsubmit.c
+++ b/cpukit/score/src/coremsgsubmit.c
@@ -25,21 +25,19 @@
#include <rtems/score/statesimpl.h>
#include <rtems/score/wkspace.h>
-CORE_message_queue_Status _CORE_message_queue_Submit(
- CORE_message_queue_Control *the_message_queue,
- Thread_Control *executing,
- const void *buffer,
- size_t size,
- Objects_Id id,
- #if defined(RTEMS_MULTIPROCESSING)
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support,
- #else
- CORE_message_queue_API_mp_support_callout api_message_queue_mp_support RTEMS_UNUSED,
- #endif
- CORE_message_queue_Submit_types submit_type,
- bool wait,
- Watchdog_Interval timeout,
- ISR_lock_Context *lock_context
+CORE_message_queue_Status _CORE_message_queue_Do_submit(
+ CORE_message_queue_Control *the_message_queue,
+ Thread_Control *executing,
+ const void *buffer,
+ size_t size,
+#if defined(RTEMS_MULTIPROCESSING)
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id,
+#endif
+ CORE_message_queue_Submit_types submit_type,
+ bool wait,
+ Watchdog_Interval timeout,
+ ISR_lock_Context *lock_context
)
{
CORE_message_queue_Buffer_control *the_message;
@@ -60,16 +58,12 @@ CORE_message_queue_Status _CORE_message_queue_Submit(
the_message_queue,
buffer,
size,
+ mp_callout,
+ mp_id,
submit_type,
lock_context
);
if ( the_thread != NULL ) {
- #if defined(RTEMS_MULTIPROCESSING)
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- (*api_message_queue_mp_support) ( the_thread, id );
-
- _Thread_Dispatch_enable( _Per_CPU_Get() );
- #endif
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
@@ -139,10 +133,6 @@ CORE_message_queue_Status _CORE_message_queue_Submit(
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT,
lock_context
);
- #if defined(RTEMS_MULTIPROCESSING)
- _Thread_Dispatch_enable( _Per_CPU_Get() );
- #endif
-
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT;
#endif
}
diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c
index da21d4bfea..1858f9c311 100644
--- a/cpukit/score/src/coremutexsurrender.c
+++ b/cpukit/score/src/coremutexsurrender.c
@@ -68,33 +68,13 @@
CORE_MUTEX_STATUS_SUCCESSFUL
#endif
-/*
- * _CORE_mutex_Surrender
- *
- * This routine frees a unit to the mutex. If a task was blocked waiting for
- * a unit from this mutex, then that task will be readied and the unit
- * given to that task. Otherwise, the unit will be returned to the mutex.
- *
- * Input parameters:
- * the_mutex - the mutex to be flushed
- * id - id of parent mutex
- * api_mutex_mp_support - api dependent MP support actions
- *
- * Output parameters:
- * CORE_MUTEX_STATUS_SUCCESSFUL - if successful
- * core error code - if unsuccessful
- */
-
-CORE_mutex_Status _CORE_mutex_Surrender(
- CORE_mutex_Control *the_mutex,
+CORE_mutex_Status _CORE_mutex_Do_surrender(
+ CORE_mutex_Control *the_mutex,
#if defined(RTEMS_MULTIPROCESSING)
- Objects_Id id,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support,
-#else
- Objects_Id id RTEMS_UNUSED,
- CORE_mutex_API_mp_support_callout api_mutex_mp_support RTEMS_UNUSED,
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id,
#endif
- ISR_lock_Context *lock_context
+ ISR_lock_Context *lock_context
)
{
Thread_Control *the_thread;
@@ -199,12 +179,12 @@ CORE_mutex_Status _CORE_mutex_Surrender(
unblock = _Thread_queue_Extract_locked(
&the_mutex->Wait_queue.Queue,
the_mutex->operations,
- the_thread
+ the_thread,
+ mp_callout,
+ mp_id
);
#if defined(RTEMS_MULTIPROCESSING)
- _Thread_Dispatch_disable();
-
if ( _Objects_Is_local_id( the_thread->Object.id ) )
#endif
{
@@ -232,16 +212,10 @@ CORE_mutex_Status _CORE_mutex_Surrender(
unblock,
&the_mutex->Wait_queue.Queue,
the_thread,
+ mp_callout,
+ mp_id,
lock_context
);
-
-#if defined(RTEMS_MULTIPROCESSING)
- if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
- ( *api_mutex_mp_support)( the_thread, id );
- }
-
- _Thread_Dispatch_enable( _Per_CPU_Get() );
-#endif
} else {
_Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
}
diff --git a/cpukit/score/src/corerwlockrelease.c b/cpukit/score/src/corerwlockrelease.c
index 36fcf76088..142ae65fef 100644
--- a/cpukit/score/src/corerwlockrelease.c
+++ b/cpukit/score/src/corerwlockrelease.c
@@ -66,7 +66,9 @@ CORE_RWLock_Status _CORE_RWLock_Release(
next = _Thread_queue_Dequeue(
&the_rwlock->Wait_queue,
- CORE_RWLOCK_TQ_OPERATIONS
+ CORE_RWLOCK_TQ_OPERATIONS,
+ NULL,
+ 0
);
if ( next ) {
diff --git a/cpukit/score/src/futex.c b/cpukit/score/src/futex.c
index 2ec38a3747..73d48fd4df 100644
--- a/cpukit/score/src/futex.c
+++ b/cpukit/score/src/futex.c
@@ -133,7 +133,9 @@ static __attribute__((noinline)) int _Futex_Wake_slow(
do_unblock = _Thread_queue_Extract_locked(
&futex->Queue.Queue,
operations,
- first
+ first,
+ NULL,
+ 0
);
if (do_unblock) {
_Chain_Append_unprotected( &unblock, &first->Wait.Node.Chain );
diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c
index b4b6d4471e..5588926973 100644
--- a/cpukit/score/src/mutex.c
+++ b/cpukit/score/src/mutex.c
@@ -145,13 +145,17 @@ static void _Mutex_Release_slow(
unblock = _Thread_queue_Extract_locked(
&mutex->Queue.Queue,
operations,
- first
+ first,
+ NULL,
+ 0
);
_Thread_queue_Boost_priority( &mutex->Queue.Queue, first );
_Thread_queue_Unblock_critical(
unblock,
&mutex->Queue.Queue,
first,
+ NULL,
+ 0,
lock_context
);
} else {
diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c
index 94e5209fad..ae1b5c72e8 100644
--- a/cpukit/score/src/semaphore.c
+++ b/cpukit/score/src/semaphore.c
@@ -133,6 +133,8 @@ void _Semaphore_Post( struct _Semaphore_Control *_sem )
&sem->Queue.Queue,
operations,
first,
+ NULL,
+ 0,
&lock_context
);
}
diff --git a/cpukit/score/src/threadmp.c b/cpukit/score/src/threadmp.c
index 33c90789b0..8ba4d4930d 100644
--- a/cpukit/score/src/threadmp.c
+++ b/cpukit/score/src/threadmp.c
@@ -102,6 +102,8 @@ Thread_Control *_Thread_MP_Allocate_proxy (
the_proxy->Wait.return_code = executing->Wait.return_code;
the_proxy->Wait.timeout_code = executing->Wait.timeout_code;
+ the_proxy->thread_queue_callout = _Thread_queue_MP_callout_do_nothing;
+
_Chain_Append( &_Thread_MP_Active_proxies, &the_proxy->Active );
return the_thread;
diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c
index f8f18ed41f..b3ccbd6f4b 100644
--- a/cpukit/score/src/threadq.c
+++ b/cpukit/score/src/threadq.c
@@ -86,3 +86,13 @@ void _Thread_queue_Initialize( Thread_queue_Control *the_thread_queue )
_SMP_lock_Stats_initialize( &the_thread_queue->Lock_stats, "Thread Queue" );
#endif
}
+
+#if defined(RTEMS_MULTIPROCESSING)
+void _Thread_queue_MP_callout_do_nothing(
+ Thread_Control *the_proxy,
+ Objects_Id mp_id
+)
+{
+ /* Do nothing */
+}
+#endif
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 71e93c292d..ce720088c8 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -33,18 +33,6 @@
#define THREAD_QUEUE_READY_AGAIN \
(THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_READY_AGAIN)
-static void _Thread_queue_Unblock( Thread_Control *the_thread )
-{
- _Thread_Timer_remove( the_thread );
- _Thread_Unblock( the_thread );
-
-#if defined(RTEMS_MULTIPROCESSING)
- if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
- _Thread_MP_Free_proxy( the_thread );
- }
-#endif
-}
-
void _Thread_queue_Enqueue_critical(
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
@@ -99,21 +87,56 @@ void _Thread_queue_Enqueue_critical(
THREAD_QUEUE_BLOCKED
);
if ( !success ) {
- _Thread_queue_Unblock( the_thread );
+ _Thread_Timer_remove( the_thread );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ if ( _Objects_Is_local_id( the_thread->Object.id ) ) {
+ _Thread_Unblock( the_thread );
+ } else {
+ Thread_Proxy_control *the_proxy;
+
+ the_proxy = (Thread_Proxy_control *) the_thread;
+ ( *the_proxy->thread_queue_callout )(
+ the_thread,
+ the_proxy->thread_queue_id
+ );
+
+ _Thread_MP_Free_proxy( the_thread );
+ }
+#else
+ _Thread_Unblock( the_thread );
+#endif
}
_Thread_Dispatch_enable( cpu_self );
}
-bool _Thread_queue_Extract_locked(
+bool _Thread_queue_Do_extract_locked(
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
Thread_Control *the_thread
+#if defined(RTEMS_MULTIPROCESSING)
+ ,
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id
+#endif
)
{
bool success;
bool unblock;
+#if defined(RTEMS_MULTIPROCESSING)
+ if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
+ Thread_Proxy_control *the_proxy;
+
+ _Assert( mp_callout != NULL );
+
+ the_proxy = (Thread_Proxy_control *) the_thread;
+ the_proxy->thread_queue_callout = mp_callout;
+ the_proxy->thread_queue_id = mp_id;
+ }
+#endif
+
( *operations->extract )( queue, the_thread );
/*
@@ -140,11 +163,15 @@ bool _Thread_queue_Extract_locked(
return unblock;
}
-void _Thread_queue_Unblock_critical(
- bool unblock,
- Thread_queue_Queue *queue,
- Thread_Control *the_thread,
- ISR_lock_Context *lock_context
+void _Thread_queue_Do_unblock_critical(
+ bool unblock,
+ Thread_queue_Queue *queue,
+ Thread_Control *the_thread,
+#if defined(RTEMS_MULTIPROCESSING)
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id,
+#endif
+ ISR_lock_Context *lock_context
)
{
if ( unblock ) {
@@ -153,7 +180,18 @@ void _Thread_queue_Unblock_critical(
cpu_self = _Thread_Dispatch_disable_critical( lock_context );
_Thread_queue_Queue_release( queue, lock_context );
- _Thread_queue_Unblock( the_thread );
+ _Thread_Timer_remove( the_thread );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ if ( _Objects_Is_local_id( the_thread->Object.id ) ) {
+ _Thread_Unblock( the_thread );
+ } else {
+ ( *mp_callout )( the_thread, mp_id );
+ _Thread_MP_Free_proxy( the_thread );
+ }
+#else
+ _Thread_Unblock( the_thread );
+#endif
_Thread_Dispatch_enable( cpu_self );
} else {
@@ -161,17 +199,35 @@ void _Thread_queue_Unblock_critical(
}
}
-void _Thread_queue_Extract_critical(
+void _Thread_queue_Do_extract_critical(
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
Thread_Control *the_thread,
+#if defined(RTEMS_MULTIPROCESSING)
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id,
+#endif
ISR_lock_Context *lock_context
)
{
bool unblock;
- unblock = _Thread_queue_Extract_locked( queue, operations, the_thread );
- _Thread_queue_Unblock_critical( unblock, queue, the_thread, lock_context );
+ unblock = _Thread_queue_Extract_locked(
+ queue,
+ operations,
+ the_thread,
+ mp_callout,
+ mp_id
+ );
+
+ _Thread_queue_Unblock_critical(
+ unblock,
+ queue,
+ the_thread,
+ mp_callout,
+ mp_id,
+ lock_context
+ );
}
void _Thread_queue_Extract( Thread_Control *the_thread )
@@ -191,6 +247,8 @@ void _Thread_queue_Extract( Thread_Control *the_thread )
queue,
the_thread->Wait.operations,
the_thread,
+ _Thread_queue_MP_callout_do_nothing,
+ 0,
&lock_context
);
} else {
@@ -198,9 +256,14 @@ void _Thread_queue_Extract( Thread_Control *the_thread )
}
}
-Thread_Control *_Thread_queue_Dequeue(
+Thread_Control *_Thread_queue_Do_dequeue(
Thread_queue_Control *the_thread_queue,
const Thread_queue_Operations *operations
+#if defined(RTEMS_MULTIPROCESSING)
+ ,
+ Thread_queue_MP_callout mp_callout,
+ Objects_Id mp_id
+#endif
)
{
ISR_lock_Context lock_context;
@@ -217,6 +280,8 @@ Thread_Control *_Thread_queue_Dequeue(
&the_thread_queue->Queue,
operations,
the_thread,
+ mp_callout,
+ mp_id,
&lock_context
);
} else {
diff --git a/cpukit/score/src/threadqflush.c b/cpukit/score/src/threadqflush.c
index 56dd80528a..c50831466d 100644
--- a/cpukit/score/src/threadqflush.c
+++ b/cpukit/score/src/threadqflush.c
@@ -51,14 +51,11 @@ void _Thread_queue_Do_flush(
&the_thread_queue->Queue,
operations,
the_thread,
+ mp_callout,
+ mp_id,
&lock_context
);
-#if defined(RTEMS_MULTIPROCESSING)
- if ( !_Objects_Is_local_id( the_thread->Object.id ) )
- ( *mp_callout )( the_thread, mp_id );
-#endif
-
_Thread_queue_Acquire( the_thread_queue, &lock_context );
}