summaryrefslogtreecommitdiff
path: root/src/progress.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2019-03-11 00:45:39 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-06 11:27:39 +0200
commit05f4e7360886e36b221ef5c3af4426625a3de686 (patch)
tree27aed9756e80eca86ff95f5805901a80048b0fb1 /src/progress.cpp
parent3b86f54fc739510277f434c68e17a93ab6448ed4 (diff)
downloadopenttd-05f4e7360886e36b221ef5c3af4426625a3de686.tar.xz
Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected. Most parts of the code assume that locking a mutex will never fail unexpectedly, which is generally true on all common platforms that don't just pretend to be C++11. The use of condition variables in driver code is checked.
Diffstat (limited to 'src/progress.cpp')
-rw-r--r--src/progress.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/progress.cpp b/src/progress.cpp
index b498be109..923f1ef83 100644
--- a/src/progress.cpp
+++ b/src/progress.cpp
@@ -10,17 +10,19 @@
/** @file progress.cpp Functions for modal progress windows. */
#include "stdafx.h"
-#include "thread/thread.h"
+#include "progress.h"
#include "safeguards.h"
/** Are we in a modal progress or not? */
bool _in_modal_progress = false;
bool _first_in_modal_loop = false;
+/** Threading usable for modal progress? */
+bool _use_threaded_modal_progress = true;
/** Rights for the performing work. */
-ThreadMutex *_modal_progress_work_mutex = ThreadMutex::New();
+std::mutex _modal_progress_work_mutex;
/** Rights for the painting. */
-ThreadMutex *_modal_progress_paint_mutex = ThreadMutex::New();
+std::mutex _modal_progress_paint_mutex;
/**
* Set the modal progress state.