diff --git a/cpukit/rtems/src/ratemonresetall.c b/cpukit/rtems/src/ratemonresetall.c index 2e73e17ac2..a8418e82c4 100644 --- a/cpukit/rtems/src/ratemonresetall.c +++ b/cpukit/rtems/src/ratemonresetall.c @@ -18,11 +18,7 @@ #include "config.h" #endif -#include -#include -#include #include -#include /* * rtems_rate_monotonic_reset_all_statistics @@ -32,13 +28,10 @@ void rtems_rate_monotonic_reset_all_statistics( void ) Objects_Id id; /* - * Prevent allocation or deallocation of any of the periods while - * we are cycling. Also this is an optimization which ensures that - * we only disable/enable once. The call to - * rtems_rate_monotonic_reset_statistics will be in a nested dispatch - * disabled critical section. + * Prevent allocation or deallocation of any of the periods while we are + * cycling. */ - _Thread_Disable_dispatch(); + _Objects_Allocator_lock(); /* * Cycle through all possible ids and try to reset each one. If it @@ -50,8 +43,5 @@ void rtems_rate_monotonic_reset_all_statistics( void ) (void) rtems_rate_monotonic_reset_statistics( id ); } - /* - * Done so exit thread dispatching disabled critical section. - */ - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); }