score: Add _Thread_Add_timeout_ticks()

Replace _Thread_Timer_insert_monotonic() with
_Thread_Add_timeout_ticks().

Update #3117.
Update #3182.
This commit is contained in:
Sebastian Huber
2017-10-24 09:29:59 +02:00
parent d85c94c0d2
commit 028786263f
4 changed files with 8 additions and 20 deletions
+1 -6
View File
@@ -81,12 +81,7 @@ rtems_status_code _Event_Seize(
_Thread_Wait_release_default( executing, lock_context );
if ( ticks ) {
_Thread_Timer_insert_monotonic(
executing,
cpu_self,
_Thread_Timeout,
ticks
);
_Thread_Add_timeout_ticks( executing, cpu_self, ticks );
}
_Thread_Set_state( executing, block_state );
+1 -6
View File
@@ -41,12 +41,7 @@ rtems_status_code rtems_task_wake_after(
} else {
_Thread_Set_state( executing, STATES_WAITING_FOR_TIME );
_Thread_Wait_flags_set( executing, THREAD_WAIT_STATE_BLOCKED );
_Thread_Timer_insert_monotonic(
executing,
cpu_self,
_Thread_Timeout,
ticks
);
_Thread_Add_timeout_ticks( executing, cpu_self, ticks );
}
_Thread_Dispatch_direct( cpu_self );
return RTEMS_SUCCESSFUL;
@@ -1857,11 +1857,10 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_initialize(
_Watchdog_Preinitialize( &timer->Watchdog, cpu );
}
RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_monotonic(
Thread_Control *the_thread,
Per_CPU_Control *cpu,
Watchdog_Service_routine_entry routine,
Watchdog_Interval ticks
RTEMS_INLINE_ROUTINE void _Thread_Add_timeout_ticks(
Thread_Control *the_thread,
Per_CPU_Control *cpu,
Watchdog_Interval ticks
)
{
ISR_lock_Context lock_context;
@@ -1870,7 +1869,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_monotonic(
the_thread->Timer.header =
&cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
the_thread->Timer.Watchdog.routine = routine;
the_thread->Timer.Watchdog.routine = _Thread_Timeout;
_Watchdog_Per_CPU_insert_ticks( &the_thread->Timer.Watchdog, cpu, ticks );
_ISR_lock_Release_and_ISR_enable( &the_thread->Timer.Lock, &lock_context );
+1 -2
View File
@@ -385,10 +385,9 @@ static void _Thread_queue_Timeout(
case WATCHDOG_RELATIVE:
/* A relative timeout of 0 is a special case indefinite (no) timeout */
if ( queue_context->timeout != 0 ) {
_Thread_Timer_insert_monotonic(
_Thread_Add_timeout_ticks(
the_thread,
cpu_self,
_Thread_Timeout,
(Watchdog_Interval) queue_context->timeout
);
}