[rtems commit] rtems: Use once mutex for timer server init

Sebastian Huber sebh at rtems.org
Wed May 20 07:12:03 UTC 2015


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon May  4 08:56:14 2015 +0200

rtems: Use once mutex for timer server init

---

 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;




More information about the vc mailing list