Merge branches 'crashlog_improvements', 'save_ext' into jgrpp
# Conflicts: # Makefile.src.in # projects/openttd_vs140.vcxproj # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj # projects/openttd_vs142.vcxproj.filters # src/core/smallstack_type.hpp # src/linkgraph/linkgraphjob.cpp # src/linkgraph/linkgraphjob.h # src/misc.cpp # src/network/network_udp.cpp # src/openttd.cpp # src/saveload/saveload.cpp
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
#include "programmable_signals.h"
|
||||
#include "smallmap_gui.h"
|
||||
#include "viewport_func.h"
|
||||
#include "thread/thread.h"
|
||||
#include "thread.h"
|
||||
#include "bridge_signal_map.h"
|
||||
#include "zoning.h"
|
||||
#include "cargopacket.h"
|
||||
@@ -77,6 +77,7 @@
|
||||
#include "tracerestrict.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <system_error>
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
@@ -613,6 +614,9 @@ int openttd_main(int argc, char *argv[])
|
||||
extern bool _dedicated_forks;
|
||||
_dedicated_forks = false;
|
||||
|
||||
std::unique_lock<std::mutex> modal_work_lock(_modal_progress_work_mutex, std::defer_lock);
|
||||
std::unique_lock<std::mutex> modal_paint_lock(_modal_progress_paint_mutex, std::defer_lock);
|
||||
|
||||
_game_mode = GM_MENU;
|
||||
_switch_mode = SM_MENU;
|
||||
_config_file = NULL;
|
||||
@@ -897,8 +901,14 @@ int openttd_main(int argc, char *argv[])
|
||||
free(musicdriver);
|
||||
|
||||
/* Take our initial lock on whatever we might want to do! */
|
||||
_modal_progress_paint_mutex->BeginCritical();
|
||||
_modal_progress_work_mutex->BeginCritical();
|
||||
try {
|
||||
modal_work_lock.lock();
|
||||
modal_paint_lock.lock();
|
||||
} catch (const std::system_error&) {
|
||||
/* If there is some error we assume that threads aren't usable on the system we run. */
|
||||
extern bool _use_threaded_modal_progress; // From progress.cpp
|
||||
_use_threaded_modal_progress = false;
|
||||
}
|
||||
|
||||
GenerateWorld(GWM_EMPTY, 64, 64); // Make the viewport initialization happy
|
||||
WaitTillGeneratedWorld();
|
||||
@@ -916,6 +926,7 @@ int openttd_main(int argc, char *argv[])
|
||||
CrashLog::MainThreadExitCheckPendingCrashlog();
|
||||
|
||||
WaitTillSaved();
|
||||
WaitTillGeneratedWorld(); // Make sure any generate world threads have been joined.
|
||||
|
||||
/* only save config if we have to */
|
||||
if (save_config) {
|
||||
|
Reference in New Issue
Block a user