summaryrefslogtreecommitdiff
path: root/src/genworld_gui.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/genworld_gui.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/genworld_gui.cpp')
-rw-r--r--src/genworld_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index d4aad6221..697ce382d 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -1321,10 +1321,10 @@ static void _SetGeneratingWorldProgress(GenWorldProgress cls, uint progress, uin
* paint thread. The 'other' thread already has the paint thread rights so
* this ensures us that we are waiting until the paint thread is done
* before we reacquire the mapgen rights */
- _modal_progress_work_mutex->EndCritical();
- _modal_progress_paint_mutex->BeginCritical();
- _modal_progress_work_mutex->BeginCritical();
- _modal_progress_paint_mutex->EndCritical();
+ _modal_progress_work_mutex.unlock();
+ _modal_progress_paint_mutex.lock();
+ _modal_progress_work_mutex.lock();
+ _modal_progress_paint_mutex.unlock();
_gws.timer = _realtime_tick;
}