summaryrefslogtreecommitdiffstats
path: root/src/uscxml/interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/interpreter')
-rw-r--r--src/uscxml/interpreter/InterpreterDraft6.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp
index 881fa8b..e044fcf 100644
--- a/src/uscxml/interpreter/InterpreterDraft6.cpp
+++ b/src/uscxml/interpreter/InterpreterDraft6.cpp
@@ -9,7 +9,6 @@ using namespace Arabica::DOM;
// see: http://www.w3.org/TR/scxml/#AlgorithmforSCXMLInterpretation
void InterpreterDraft6::interpret() {
-// _mutex.lock();
tthread::lock_guard<tthread::recursive_mutex> lock(_mutex);
if (!_isInitialized)
init();
@@ -264,7 +263,11 @@ void InterpreterDraft6::mainEventLoop() {
while(_externalQueue.isEmpty() && _thread == NULL) {
runOnMainThread(200);
}
+ _mutex.lock();
+ while(_externalQueue.isEmpty()) {
+ _condVar.wait(_mutex);
+ }
_currEvent = _externalQueue.pop();
#if VERBOSE
std::cout << "Received externalEvent event " << _currEvent.name << std::endl;
@@ -273,8 +276,6 @@ void InterpreterDraft6::mainEventLoop() {
if (!_running)
goto EXIT_INTERPRETER;
- _mutex.lock();
-
if (_dataModel && boost::iequals(_currEvent.name, "cancel.invoke." + _sessionId))
break;