diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-01 11:38:47 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-06 09:08:21 +0200 |
commit | 8f9658187a46f3c3ee3d7c7b68491fab5175a8fd (patch) | |
tree | c1887c2441887909201698b8d16b8cb2e8598188 /cpukit/posix | |
parent | score: Simplify _Thread_queue_Do_flush() (diff) | |
download | rtems-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/posix')
-rw-r--r-- | cpukit/posix/include/rtems/posix/pthreadimpl.h | 4 | ||||
-rw-r--r-- | cpukit/posix/src/condsignalsupp.c | 4 | ||||
-rw-r--r-- | cpukit/posix/src/mqueuesendsupp.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/mutexsetprioceiling.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/mutexunlock.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/pbarrierwait.c | 4 | ||||
-rw-r--r-- | cpukit/posix/src/sempost.c | 6 |
7 files changed, 12 insertions, 12 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h index 14db6f0371..42f10b08bc 100644 --- a/cpukit/posix/include/rtems/posix/pthreadimpl.h +++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h @@ -217,7 +217,9 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Join_dequeue( { return _Thread_queue_Dequeue( &api->Join_List, - POSIX_THREAD_JOIN_TQ_OPERATIONS + POSIX_THREAD_JOIN_TQ_OPERATIONS, + NULL, + 0 ); } diff --git a/cpukit/posix/src/condsignalsupp.c b/cpukit/posix/src/condsignalsupp.c index b2a0b1afe8..9c67ddc030 100644 --- a/cpukit/posix/src/condsignalsupp.c +++ b/cpukit/posix/src/condsignalsupp.c @@ -49,7 +49,9 @@ int _POSIX_Condition_variables_Signal_support( do { the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue, - POSIX_CONDITION_VARIABLES_TQ_OPERATIONS + POSIX_CONDITION_VARIABLES_TQ_OPERATIONS, + NULL, + 0 ); if ( !the_thread ) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; diff --git a/cpukit/posix/src/mqueuesendsupp.c b/cpukit/posix/src/mqueuesendsupp.c index 976d1e0115..e15870643c 100644 --- a/cpukit/posix/src/mqueuesendsupp.c +++ b/cpukit/posix/src/mqueuesendsupp.c @@ -105,8 +105,8 @@ int _POSIX_Message_queue_Send_support( executing, msg_ptr, msg_len, - mqdes, /* mqd_t is an object id */ NULL, + 0, _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout, /* no timeout */ diff --git a/cpukit/posix/src/mutexsetprioceiling.c b/cpukit/posix/src/mutexsetprioceiling.c index 8b966bafc7..718bfc4167 100644 --- a/cpukit/posix/src/mutexsetprioceiling.c +++ b/cpukit/posix/src/mutexsetprioceiling.c @@ -81,8 +81,8 @@ int pthread_mutex_setprioceiling( */ _CORE_mutex_Surrender( &the_mutex->Mutex, - the_mutex->Object.id, NULL, + 0, &lock_context ); diff --git a/cpukit/posix/src/mutexunlock.c b/cpukit/posix/src/mutexunlock.c index a8b28db699..1a83a0a241 100644 --- a/cpukit/posix/src/mutexunlock.c +++ b/cpukit/posix/src/mutexunlock.c @@ -52,8 +52,8 @@ int pthread_mutex_unlock( case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( &the_mutex->Mutex, - the_mutex->Object.id, NULL, + 0, &lock_context ); return _POSIX_Mutex_Translate_core_mutex_return_code( status ); diff --git a/cpukit/posix/src/pbarrierwait.c b/cpukit/posix/src/pbarrierwait.c index 560e10146d..fd94e4521e 100644 --- a/cpukit/posix/src/pbarrierwait.c +++ b/cpukit/posix/src/pbarrierwait.c @@ -55,10 +55,10 @@ int pthread_barrier_wait( _CORE_barrier_Wait( &the_barrier->Barrier, executing, - the_barrier->Object.id, true, 0, - NULL + NULL, + 0 ); _Objects_Put( &the_barrier->Object ); return _POSIX_Barrier_Translate_core_barrier_return_code( diff --git a/cpukit/posix/src/sempost.c b/cpukit/posix/src/sempost.c index aa0c974117..8e8cce9251 100644 --- a/cpukit/posix/src/sempost.c +++ b/cpukit/posix/src/sempost.c @@ -48,12 +48,8 @@ int sem_post( case OBJECTS_LOCAL: _CORE_semaphore_Surrender( &the_semaphore->Semaphore, - the_semaphore->Object.id, -#if defined(RTEMS_MULTIPROCESSING) - NULL, /* POSIX Semaphores are local only */ -#else NULL, -#endif + 0, &lock_context ); return 0; |