summaryrefslogtreecommitdiffstats
path: root/src/control/RPGEdit.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 03:19:55 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 03:19:55 +0200
commitba321783e7f66068a5a5379992a8e081a70bf243 (patch)
treebf99da94566abbd92a330bab79c78319424a25b8 /src/control/RPGEdit.cpp
parentb5c7b4a162a780980b3ecacf0edd49541888a0a8 (diff)
downloadrpgedit-ba321783e7f66068a5a5379992a8e081a70bf243.tar
rpgedit-ba321783e7f66068a5a5379992a8e081a70bf243.zip
Simplify thread synchronization
Diffstat (limited to 'src/control/RPGEdit.cpp')
-rw-r--r--src/control/RPGEdit.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/control/RPGEdit.cpp b/src/control/RPGEdit.cpp
index 0f31468..e8d71a6 100644
--- a/src/control/RPGEdit.cpp
+++ b/src/control/RPGEdit.cpp
@@ -74,12 +74,7 @@ void RPGEdit::systemLoop() {
{
std::unique_lock<std::mutex> lock(modelMutex);
- uint64_t time = timeProvider.now();
-
- while (time >= handledTime) {
- modelCond.wait(lock);
- time = timeProvider.now();
- }
+ uint64_t time = std::min(timeProvider.now(), handledTime);
Model::Position pos = ctx->getViewPosition(time);
mapView->render(pos.x, pos.y, time);
@@ -102,7 +97,6 @@ void RPGEdit::eventLoop() {
event.second();
handledTime = eventBus.peek();
- modelCond.notify_one();
}
}
}