[rtems commit] rtems: Use object allocator lock

Sebastian Huber sebh at rtems.org
Tue Mar 22 06:44:31 UTC 2016


Module:    rtems
Branch:    master
Commit:    30cac38f157f0b4bd10a9b310e3dd6fdfc1d242e
Changeset: http://git.rtems.org/rtems/commit/?id=30cac38f157f0b4bd10a9b310e3dd6fdfc1d242e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 22 07:40:18 2016 +0100

rtems: Use object allocator lock

Object creation and destruction is protected by the object allocator
lock and not disabled thread dispatching.

Update #2555.

---

 cpukit/rtems/src/ratemonresetall.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/cpukit/rtems/src/ratemonresetall.c b/cpukit/rtems/src/ratemonresetall.c
index 2e73e17..a8418e8 100644
--- a/cpukit/rtems/src/ratemonresetall.c
+++ b/cpukit/rtems/src/ratemonresetall.c
@@ -18,11 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
 #include <rtems/rtems/ratemonimpl.h>
-#include <rtems/score/thread.h>
 
 /*
  *  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();
 }




More information about the vc mailing list