summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadrestart.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-23 11:40:18 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-25 12:43:54 +0200
commit631b3c8967a329cdd53e54365e4e4c0aa93a4251 (patch)
tree3a750b145a90c90aa86222c26ee68aeb8c87a417 /cpukit/score/src/threadrestart.c
parentscore: Get rid of mp_id parameter (diff)
downloadrtems-631b3c8967a329cdd53e54365e4e4c0aa93a4251.tar.bz2
score: Move thread queue MP callout to context
Drop the multiprocessing (MP) dependent callout parameter from the thread queue extract, dequeue, flush and unblock methods. Merge this parameter with the lock context into new structure Thread_queue_Context. This helps to gets rid of the conditionally compiled method call helpers.
Diffstat (limited to 'cpukit/score/src/threadrestart.c')
-rw-r--r--cpukit/score/src/threadrestart.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 30536f748a..52d68de69a 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -87,24 +87,24 @@ static void _Thread_Raise_real_priority(
}
typedef struct {
- ISR_lock_Context Base;
+ Thread_queue_Context Base;
#if defined(RTEMS_POSIX_API)
- void *exit_value;
+ void *exit_value;
#endif
-} Thread_Join_lock_context;
+} Thread_Join_context;
#if defined(RTEMS_POSIX_API)
static Thread_Control *_Thread_Join_flush_filter(
- Thread_Control *the_thread,
- Thread_queue_Queue *queue,
- ISR_lock_Context *lock_context
+ Thread_Control *the_thread,
+ Thread_queue_Queue *queue,
+ Thread_queue_Context *queue_context
)
{
- Thread_Join_lock_context *join_lock_context;
+ Thread_Join_context *join_context;
- join_lock_context = (Thread_Join_lock_context *) lock_context;
+ join_context = (Thread_Join_context *) queue_context;
- the_thread->Wait.return_argument = join_lock_context->exit_value;
+ the_thread->Wait.return_argument = join_context->exit_value;
return the_thread;
}
@@ -112,13 +112,17 @@ static Thread_Control *_Thread_Join_flush_filter(
static void _Thread_Wake_up_joining_threads( Thread_Control *the_thread )
{
- Thread_Join_lock_context join_lock_context;
+ Thread_Join_context join_context;
#if defined(RTEMS_POSIX_API)
- join_lock_context.exit_value = the_thread->Life.exit_value;
+ join_context.exit_value = the_thread->Life.exit_value;
#endif
- _Thread_State_acquire( the_thread, &join_lock_context.Base );
+ _Thread_queue_Context_initialize( &join_context.Base, NULL );
+ _Thread_queue_Acquire(
+ &the_thread->Join_queue,
+ &join_context.Base.Lock_context
+ );
_Thread_queue_Flush_critical(
&the_thread->Join_queue.Queue,
THREAD_JOIN_TQ_OPERATIONS,
@@ -127,8 +131,7 @@ static void _Thread_Wake_up_joining_threads( Thread_Control *the_thread )
#else
_Thread_queue_Flush_default_filter,
#endif
- NULL,
- &join_lock_context.Base
+ &join_context.Base
);
}