Index: trunk/FACT++/src/StateMachineImp.cc
===================================================================
--- trunk/FACT++/src/StateMachineImp.cc	(revision 16729)
+++ trunk/FACT++/src/StateMachineImp.cc	(revision 16730)
@@ -167,4 +167,5 @@
     const lock_guard<mutex> guard(fMutex);
     fEventQueue.emplace_back(cmd);
+    fCond.notify_one();
 }
 
@@ -1008,23 +1009,32 @@
         SetCurrentState(kSM_Ready, "by Run()");
 
-        while (!fExitRequested)
+        std::unique_lock<std::mutex> lock(fMutex);
+        fMutex.unlock();
+
+        while (1)
         {
-            usleep(1);
+            fMutex.lock();
+            if (IsQueueEmpty())
+                fCond.wait_for(lock, chrono::microseconds(10000));
+            fMutex.unlock();
+
+            if (fExitRequested)
+                break;
+
             if (dummy)
                 continue;
 
+            // If the command stack is empty go on with processing in the
+            // current state
+            if (!IsQueueEmpty())
+            {
+                // Pop the next command which arrived from the stack
+                const shared_ptr<Event> cmd(PopEvent());
+                if (!HandleEvent(*cmd))
+                    break;
+            }
+
             // Execute a step in the current state of the state machine
             if (!HandleNewState(Execute(), 0, "by Execute-command"))
-                break;
-
-            // If the command stack is empty go on with processing in the
-            // current state
-            if (IsQueueEmpty())
-                continue;
-
-            // Pop the next command which arrived from the stack
-            const shared_ptr<Event> cmd(PopEvent());
-
-            if (!HandleEvent(*cmd))
                 break;
         }
Index: trunk/FACT++/src/StateMachineImp.h
===================================================================
--- trunk/FACT++/src/StateMachineImp.h	(revision 16729)
+++ trunk/FACT++/src/StateMachineImp.h	(revision 16730)
@@ -7,4 +7,5 @@
 #include <vector>
 #include <memory>
+#include <condition_variable>
 
 #include "MainImp.h"
@@ -49,4 +50,6 @@
     std::mutex fMutexEvt; /// Mutex to ensure thread-safe access to the command fifo
 
+    std::condition_variable fCond; /// Conditional to signal run the an event is waiting
+
     bool fBufferEvents;  /// Flag if events should be buffered outside the event loop
 
