[PATCH 10/45] rtems: Use once mutex for timer server init

Sebastian Huber sebastian.huber at embedded-brains.de
Fri May 15 11:41:10 UTC 2015


---
 cpukit/rtems/src/timerserver.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index db38f48..047fd09 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -29,6 +29,7 @@
 #include <rtems.h>
 #include <rtems/rtems/timerimpl.h>
 #include <rtems/rtems/tasksimpl.h>
+#include <rtems/score/apimutex.h>
 #include <rtems/score/todimpl.h>
 
 static Timer_server_Control _Timer_server_Default;
@@ -346,10 +347,10 @@ rtems_status_code rtems_timer_initiate_server(
   /*
    *  Just to make sure this is only called once.
    */
-  _Thread_Disable_dispatch();
+  _Once_Lock();
     tmpInitialized  = initialized;
     initialized = true;
-  _Thread_Enable_dispatch();
+  _Once_Unlock();
 
   if ( tmpInitialized )
     return RTEMS_INCORRECT_STATE;
-- 
1.8.4.5




More information about the devel mailing list