forked from Imagelibrary/rtems
score: Simplify _Watchdog_Tick()
Move thread dispatch disable check to legacy rtems_clock_tick(). Assert that thread dispatching is disabled in _Watchdog_Tick(). This is usually the case, since this function is called in interrupt context by the clock tick service routine.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <rtems/rtems/clock.h>
|
||||
#include <rtems/score/timecounter.h>
|
||||
#include <rtems/score/threadimpl.h>
|
||||
|
||||
rtems_status_code rtems_clock_tick( void )
|
||||
{
|
||||
@@ -32,5 +33,9 @@ rtems_status_code rtems_clock_tick( void )
|
||||
&lock_context
|
||||
);
|
||||
|
||||
if ( _Thread_Dispatch_is_enabled() ) {
|
||||
_Thread_Dispatch();
|
||||
}
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
* http://www.rtems.org/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/assert.h>
|
||||
#include <rtems/score/schedulerimpl.h>
|
||||
#include <rtems/score/threadimpl.h>
|
||||
#include <rtems/score/threaddispatch.h>
|
||||
#include <rtems/score/todimpl.h>
|
||||
#include <rtems/score/watchdogimpl.h>
|
||||
|
||||
@@ -23,12 +24,11 @@
|
||||
|
||||
void _Watchdog_Tick( void )
|
||||
{
|
||||
_Assert( !_Thread_Dispatch_is_enabled() );
|
||||
|
||||
_TOD_Tickle_ticks();
|
||||
|
||||
_Watchdog_Tickle_ticks();
|
||||
|
||||
_Scheduler_Tick();
|
||||
|
||||
if ( _Thread_Dispatch_is_enabled() )
|
||||
_Thread_Dispatch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user