From 6de1f92121f947f9c379747d66135fd8a500d0f5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 19 Oct 2017 13:41:25 +0200 Subject: score: Add _Thread_Continue() Update #3117. Update #3182. --- cpukit/score/src/threadtimeout.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'cpukit/score/src/threadtimeout.c') diff --git a/cpukit/score/src/threadtimeout.c b/cpukit/score/src/threadtimeout.c index 8bcdc3806d..8ea5a651f0 100644 --- a/cpukit/score/src/threadtimeout.c +++ b/cpukit/score/src/threadtimeout.c @@ -22,14 +22,11 @@ #include #include -void _Thread_Timeout( Watchdog_Control *watchdog ) +void _Thread_Continue( Thread_Control *the_thread, Status_Control status ) { - Thread_Control *the_thread; - Thread_queue_Context queue_context; - Thread_Wait_flags wait_flags; - bool unblock; - - the_thread = RTEMS_CONTAINER_OF( watchdog, Thread_Control, Timer.Watchdog ); + Thread_queue_Context queue_context; + Thread_Wait_flags wait_flags; + bool unblock; _Thread_queue_Context_initialize( &queue_context ); _Thread_queue_Context_clear_priority_updates( &queue_context ); @@ -44,7 +41,7 @@ void _Thread_Timeout( Watchdog_Control *watchdog ) _Thread_Wait_cancel( the_thread, &queue_context ); - the_thread->Wait.return_code = STATUS_TIMEOUT; + the_thread->Wait.return_code = status; wait_class = wait_flags & THREAD_WAIT_CLASS_MASK; ready_again = wait_class | THREAD_WAIT_STATE_READY_AGAIN; @@ -82,3 +79,15 @@ void _Thread_Timeout( Watchdog_Control *watchdog ) #endif } } + +void _Thread_Timeout( Watchdog_Control *the_watchdog ) +{ + Thread_Control *the_thread; + + the_thread = RTEMS_CONTAINER_OF( + the_watchdog, + Thread_Control, + Timer.Watchdog + ); + _Thread_Continue( the_thread, STATUS_TIMEOUT ); +} -- cgit v1.2.3