summaryrefslogtreecommitdiffstats
path: root/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-16 18:35:17 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-16 18:35:17 (GMT)
commit60c543c1d8c6699cc96829f15b16ecc60ac0b410 (patch)
treef0087f620d45246acf0268da539cb815796d88c0 /src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp
parent4d186e24e44fe07f04708c2dc38387534c02c7fd (diff)
downloaduscxml-60c543c1d8c6699cc96829f15b16ecc60ac0b410.zip
uscxml-60c543c1d8c6699cc96829f15b16ecc60ac0b410.tar.gz
uscxml-60c543c1d8c6699cc96829f15b16ecc60ac0b410.tar.bz2
Added license information and bug fixes
Diffstat (limited to 'src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp')
-rw-r--r--src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp b/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp
index 28bd343..b29c9ca 100644
--- a/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp
+++ b/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp
@@ -1,3 +1,22 @@
+/**
+ * @file
+ * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
#include "uscxml/Message.h"
#include "DelayedEventQueue.h"
#include <glog/logging.h>
@@ -31,8 +50,12 @@ void DelayedEventQueue::run(void* instance) {
DelayedEventQueue* INSTANCE = (DelayedEventQueue*)instance;
int result;
while(INSTANCE->_isStarted) {
+#ifndef EVLOOP_NO_EXIT_ON_EMPTY
+ result = event_base_dispatch(INSTANCE->_eventLoop);
+#else
//result = event_base_dispatch(THIS->_eventLoop);
result = event_base_loop(INSTANCE->_eventLoop, EVLOOP_NO_EXIT_ON_EMPTY);
+#endif
(void)result;
}
}
@@ -53,7 +76,7 @@ void DelayedEventQueue::addEvent(std::string eventId, int fd, short opMask, void
_callbackData[eventId].callback = callback;
_callbackData[eventId].event = event;
_callbackData[eventId].persist = false;
-
+
event_add(event, NULL);
}