Index: ps/trunk/source/graphics/MapGenerator.h =================================================================== --- ps/trunk/source/graphics/MapGenerator.h +++ ps/trunk/source/graphics/MapGenerator.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -186,7 +186,7 @@ /** * Perform map generation in an independent thread. */ - static void* RunThread(CMapGeneratorWorker* self); + static void RunThread(CMapGeneratorWorker* self); /** * Perform the map generation. Index: ps/trunk/source/graphics/MapGenerator.cpp =================================================================== --- ps/trunk/source/graphics/MapGenerator.cpp +++ ps/trunk/source/graphics/MapGenerator.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,6 +30,7 @@ #include "ps/CLogger.h" #include "ps/FileIo.h" #include "ps/Profile.h" +#include "ps/Threading.h" #include "ps/scripting/JSInterface_VFS.h" #include "scriptinterface/ScriptContext.h" #include "scriptinterface/ScriptConversions.h" @@ -81,10 +82,10 @@ m_Settings = settings; // Launch the worker thread - m_WorkerThread = std::thread(RunThread, this); + m_WorkerThread = std::thread(Threading::HandleExceptions::Wrapper, this); } -void* CMapGeneratorWorker::RunThread(CMapGeneratorWorker* self) +void CMapGeneratorWorker::RunThread(CMapGeneratorWorker* self) { debug_SetThreadName("MapGenerator"); g_Profiler2.RegisterCurrentThread("MapGenerator"); @@ -109,8 +110,6 @@ // At this point the random map scripts are done running, so the thread has no further purpose // and can die. The data will be stored in m_MapData already if successful, or m_Progress // will contain an error value on failure. - - return NULL; } bool CMapGeneratorWorker::Run() Index: ps/trunk/source/graphics/ShaderDefines.cpp =================================================================== --- ps/trunk/source/graphics/ShaderDefines.cpp +++ ps/trunk/source/graphics/ShaderDefines.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -80,7 +80,7 @@ template typename CShaderParams::SItems* CShaderParams::GetInterned(const SItems& items) { - ENSURE(ThreadUtil::IsMainThread()); // s_InternedItems is not thread-safe + ENSURE(Threading::IsMainThread()); // s_InternedItems is not thread-safe typename InternedItems_t::iterator it = s_InternedItems.find(items); if (it != s_InternedItems.end()) Index: ps/trunk/source/graphics/TextureConverter.cpp =================================================================== --- ps/trunk/source/graphics/TextureConverter.cpp +++ ps/trunk/source/graphics/TextureConverter.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -27,6 +27,7 @@ #include "ps/CLogger.h" #include "ps/CStr.h" #include "ps/Profiler2.h" +#include "ps/Threading.h" #include "ps/XML/Xeromyces.h" #if CONFIG2_NVTT @@ -298,7 +299,7 @@ ENSURE(nvtt::version() >= NVTT_VERSION); #endif - m_WorkerThread = std::thread(RunThread, this); + m_WorkerThread = std::thread(Threading::HandleExceptions::Wrapper, this); // Maybe we should share some centralised pool of worker threads? // For now we'll just stick with a single thread for this specific use. Index: ps/trunk/source/lib/sysdep/os/win/wseh.h =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wseh.h +++ ps/trunk/source/lib/sysdep/os/win/wseh.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,8 @@ #ifndef INCLUDED_WSEH #define INCLUDED_WSEH +#include + struct _EXCEPTION_POINTERS; extern long __stdcall wseh_ExceptionFilter(_EXCEPTION_POINTERS* ep); Index: ps/trunk/source/lib/sysdep/os/win/wutil.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wutil.cpp +++ ps/trunk/source/lib/sysdep/os/win/wutil.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -44,6 +44,9 @@ WINIT_REGISTER_LATE_SHUTDOWN(wutil_Shutdown); +// Defined in ps/Pyrogenesis.h +extern const char* main_window_name; + //----------------------------------------------------------------------------- // safe allocator @@ -528,7 +531,12 @@ UNUSED2(tid); if(pid == GetCurrentProcessId()) - hAppWindow = hWnd; + { + char windowName[100]; + GetWindowTextA(hWnd, windowName, 99); + if (strcmp(windowName, main_window_name) == 0) + hAppWindow = hWnd; + } return TRUE; // keep calling } Index: ps/trunk/source/network/NetClient.cpp =================================================================== --- ps/trunk/source/network/NetClient.cpp +++ ps/trunk/source/network/NetClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -34,6 +34,7 @@ #include "ps/Game.h" #include "ps/Loader.h" #include "ps/Profile.h" +#include "ps/Threading.h" #include "scriptinterface/ScriptInterface.h" #include "simulation2/Simulation2.h" @@ -175,7 +176,7 @@ CNetClientSession* session = new CNetClientSession(*this); bool ok = session->Connect(server, port, m_IsLocalClient, enetClient); SetAndOwnSession(session); - m_PollingThread = std::thread(CNetClientSession::RunNetLoop, m_Session); + m_PollingThread = std::thread(Threading::HandleExceptions::Wrapper, m_Session); return ok; } Index: ps/trunk/source/network/NetServer.cpp =================================================================== --- ps/trunk/source/network/NetServer.cpp +++ ps/trunk/source/network/NetServer.cpp @@ -32,6 +32,7 @@ #include "ps/ConfigDB.h" #include "ps/GUID.h" #include "ps/Profile.h" +#include "ps/Threading.h" #include "scriptinterface/ScriptContext.h" #include "scriptinterface/ScriptInterface.h" #include "simulation2/Simulation2.h" @@ -205,11 +206,11 @@ m_State = SERVER_STATE_PREGAME; // Launch the worker thread - m_WorkerThread = std::thread(RunThread, this); + m_WorkerThread = std::thread(Threading::HandleExceptions::Wrapper, this); #if CONFIG2_MINIUPNPC // Launch the UPnP thread - m_UPnPThread = std::thread(SetupUPnP); + m_UPnPThread = std::thread(Threading::HandleExceptions::Wrapper); #endif return true; Index: ps/trunk/source/ps/CStrIntern.cpp =================================================================== --- ps/trunk/source/ps/CStrIntern.cpp +++ ps/trunk/source/ps/CStrIntern.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -98,7 +98,7 @@ // g_Strings is not thread-safe, so complain if anyone is using this // type in non-main threads. (If that's desired, g_Strings should be changed // to be thread-safe, preferably without sacrificing performance.) - ENSURE(ThreadUtil::IsMainThread()); + ENSURE(Threading::IsMainThread()); std::unordered_map >::iterator it = g_Strings.find(str); Index: ps/trunk/source/ps/GameSetup/GameSetup.cpp =================================================================== --- ps/trunk/source/ps/GameSetup/GameSetup.cpp +++ ps/trunk/source/ps/GameSetup/GameSetup.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -355,7 +355,7 @@ // displaying the error dialog hangs the desktop since the dialog box is behind the // fullscreen window. So we just force the game to windowed mode before displaying the dialog. // (But only if we're in the main thread, and not if we're being reentrant.) - if (ThreadUtil::IsMainThread()) + if (Threading::IsMainThread()) { static bool reentering = false; if (!reentering) @@ -828,7 +828,7 @@ // If you ever want to catch a particular allocation: //_CrtSetBreakAlloc(232647); - ThreadUtil::SetMainThread(); + Threading::SetMainThread(); debug_SetThreadName("main"); // add all debug_printf "tags" that we are interested in: Index: ps/trunk/source/ps/Profile.cpp =================================================================== --- ps/trunk/source/ps/Profile.cpp +++ ps/trunk/source/ps/Profile.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -438,7 +438,7 @@ static int crt_alloc_hook(int allocType, void* userData, size_t size, int blockType, long requestNumber, const unsigned char* filename, int lineNumber) { - if (allocType == _HOOK_ALLOC && ThreadUtil::IsMainThread()) + if (allocType == _HOOK_ALLOC && Threading::IsMainThread()) ++malloc_count; if (prev_hook) @@ -760,7 +760,7 @@ if (CProfileManager::IsInitialised()) { // The profiler is only safe to use on the main thread - if(ThreadUtil::IsMainThread()) + if(Threading::IsMainThread()) g_Profiler.Start(name); } } @@ -768,6 +768,6 @@ CProfileSample::~CProfileSample() { if (CProfileManager::IsInitialised()) - if(ThreadUtil::IsMainThread()) + if(Threading::IsMainThread()) g_Profiler.Stop(); } Index: ps/trunk/source/ps/Profiler2.h =================================================================== --- ps/trunk/source/ps/Profiler2.h +++ ps/trunk/source/ps/Profiler2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -336,7 +336,7 @@ */ void RecordFrameStart() { - ENSURE(ThreadUtil::IsMainThread()); + ENSURE(Threading::IsMainThread()); GetThreadStorage().RecordFrameStart(GetTime()); } Index: ps/trunk/source/ps/Profiler2.cpp =================================================================== --- ps/trunk/source/ps/Profiler2.cpp +++ ps/trunk/source/ps/Profiler2.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -254,7 +254,7 @@ // the destructor is not called for the main thread // we have to call it manually to avoid memory leaks - ENSURE(ThreadUtil::IsMainThread()); + ENSURE(Threading::IsMainThread()); m_Initialised = false; } Index: ps/trunk/source/ps/Pyrogenesis.h =================================================================== --- ps/trunk/source/ps/Pyrogenesis.h +++ ps/trunk/source/ps/Pyrogenesis.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -28,6 +28,7 @@ using OsPath = Path; extern const char* engine_version; +extern const char* main_window_name; extern void psBundleLogs(FILE* f); // set during InitVfs extern void psSetLogDir(const OsPath& logDir); // set during InitVfs Index: ps/trunk/source/ps/Pyrogenesis.cpp =================================================================== --- ps/trunk/source/ps/Pyrogenesis.cpp +++ ps/trunk/source/ps/Pyrogenesis.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -25,6 +25,7 @@ #include "lib/svn_revision.h" const char* engine_version = "0.0.24"; +const char* main_window_name = "0 A.D."; // convert contents of file from char to wchar_t and // append to file. Index: ps/trunk/source/ps/ThreadUtil.h =================================================================== --- ps/trunk/source/ps/ThreadUtil.h +++ ps/trunk/source/ps/ThreadUtil.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,7 +18,12 @@ #ifndef INCLUDED_THREADUTIL #define INCLUDED_THREADUTIL -namespace ThreadUtil +/** + * Light-weight threading utilities. + * Implemented in Threading.cpp. + * Split from Threading because this is included (via profilers) in most files. + */ +namespace Threading { /** Index: ps/trunk/source/ps/ThreadUtil.cpp =================================================================== --- ps/trunk/source/ps/ThreadUtil.cpp +++ ps/trunk/source/ps/ThreadUtil.cpp @@ -1,41 +0,0 @@ -/* Copyright (C) 2019 Wildfire Games. - * This file is part of 0 A.D. - * - * 0 A.D. is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * 0 A.D. 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. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with 0 A.D. If not, see . - */ - -#include "precompiled.h" - -#include - -#include "ThreadUtil.h" - -static bool g_MainThreadSet; -static std::thread::id g_MainThread; - -bool ThreadUtil::IsMainThread() -{ - // If SetMainThread hasn't been called yet, this is probably being - // called at static initialisation time, so it must be the main thread - if (!g_MainThreadSet) - return true; - - return g_MainThread == std::this_thread::get_id(); -} - -void ThreadUtil::SetMainThread() -{ - g_MainThread = std::this_thread::get_id(); - g_MainThreadSet = true; -} Index: ps/trunk/source/ps/Threading.h =================================================================== --- ps/trunk/source/ps/Threading.h +++ ps/trunk/source/ps/Threading.h @@ -0,0 +1,61 @@ +/* Copyright (C) 2021 Wildfire Games. + * This file is part of 0 A.D. + * + * 0 A.D. is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * 0 A.D. 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 0 A.D. If not, see . + */ + +#ifndef INCLUDED_THREADING +#define INCLUDED_THREADING + +#include "ThreadUtil.h" + +#if OS_WIN +#include "lib/sysdep/os/win/wseh.h" +#endif + +namespace Threading +{ + +/** + * Wrap a function to handle exceptions. + * This currently deals with Windows Structured Exception Handling (see wseh.cpp) + */ +template +struct HandleExceptionsBase {}; +template +struct HandleExceptions : public HandleExceptionsBase {}; + +template +struct HandleExceptionsBase +{ + static void Wrapper(Types... args) + { +#if OS_WIN + __try + { + functionPtr(args...); + } + __except(wseh_ExceptionFilter(GetExceptionInformation())) + { + // Nothing particular to do. + } +#else + functionPtr(args...); +#endif + } +}; + +} + +#endif // INCLUDED_THREADING Index: ps/trunk/source/ps/Threading.cpp =================================================================== --- ps/trunk/source/ps/Threading.cpp +++ ps/trunk/source/ps/Threading.cpp @@ -0,0 +1,41 @@ +/* Copyright (C) 2021 Wildfire Games. + * This file is part of 0 A.D. + * + * 0 A.D. is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * 0 A.D. 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 0 A.D. If not, see . + */ + +#include "precompiled.h" + +#include "Threading.h" + +#include + +static bool g_MainThreadSet; +static std::thread::id g_MainThread; + +bool Threading::IsMainThread() +{ + // If SetMainThread hasn't been called yet, this is probably being + // called at static initialisation time, so it must be the main thread + if (!g_MainThreadSet) + return true; + + return g_MainThread == std::this_thread::get_id(); +} + +void Threading::SetMainThread() +{ + g_MainThread = std::this_thread::get_id(); + g_MainThreadSet = true; +} Index: ps/trunk/source/ps/UserReport.cpp =================================================================== --- ps/trunk/source/ps/UserReport.cpp +++ ps/trunk/source/ps/UserReport.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,6 +30,7 @@ #include "ps/Filesystem.h" #include "ps/Profiler2.h" #include "ps/Pyrogenesis.h" +#include "ps/Threading.h" #include #include @@ -138,7 +139,7 @@ m_Headers = curl_slist_append(m_Headers, "Accept: "); curl_easy_setopt(m_Curl, CURLOPT_HTTPHEADER, m_Headers); - m_WorkerThread = std::thread(RunThread, this); + m_WorkerThread = std::thread(Threading::HandleExceptions::Wrapper, this); } ~CUserReporterWorker() Index: ps/trunk/source/ps/VideoMode.cpp =================================================================== --- ps/trunk/source/ps/VideoMode.cpp +++ ps/trunk/source/ps/VideoMode.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -32,6 +32,7 @@ #include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/Game.h" +#include "ps/Pyrogenesis.h" #include "ps/GameSetup/Config.h" #include "renderer/Renderer.h" @@ -82,7 +83,7 @@ flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE; m_WindowedX = m_WindowedY = SDL_WINDOWPOS_CENTERED_DISPLAY(m_ConfigDisplay); - m_Window = SDL_CreateWindow("0 A.D.", m_WindowedX, m_WindowedY, w, h, flags); + m_Window = SDL_CreateWindow(main_window_name, m_WindowedX, m_WindowedY, w, h, flags); if (!m_Window) { // If fullscreen fails, try windowed mode Index: ps/trunk/source/scriptinterface/ScriptContext.cpp =================================================================== --- ps/trunk/source/scriptinterface/ScriptContext.cpp +++ ps/trunk/source/scriptinterface/ScriptContext.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -38,13 +38,13 @@ if (progress == JS::GC_SLICE_BEGIN) { - if (CProfileManager::IsInitialised() && ThreadUtil::IsMainThread()) + if (CProfileManager::IsInitialised() && Threading::IsMainThread()) g_Profiler.Start("GCSlice"); g_Profiler2.RecordRegionEnter("GCSlice"); } else if (progress == JS::GC_SLICE_END) { - if (CProfileManager::IsInitialised() && ThreadUtil::IsMainThread()) + if (CProfileManager::IsInitialised() && Threading::IsMainThread()) g_Profiler.Stop(); g_Profiler2.RecordRegionLeave(); } Index: ps/trunk/source/scriptinterface/ScriptInterface.cpp =================================================================== --- ps/trunk/source/scriptinterface/ScriptInterface.cpp +++ ps/trunk/source/scriptinterface/ScriptInterface.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -231,7 +231,7 @@ name = StringFlyweight(str).get().c_str(); } - if (CProfileManager::IsInitialised() && ThreadUtil::IsMainThread()) + if (CProfileManager::IsInitialised() && Threading::IsMainThread()) g_Profiler.StartScript(name); g_Profiler2.RecordRegionEnter(name); @@ -243,7 +243,7 @@ bool ProfileStop(JSContext* UNUSED(cx), uint argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (CProfileManager::IsInitialised() && ThreadUtil::IsMainThread()) + if (CProfileManager::IsInitialised() && Threading::IsMainThread()) g_Profiler.Stop(); g_Profiler2.RecordRegionLeave(); @@ -368,7 +368,7 @@ m(new ScriptInterface_impl(nativeScopeName, context)) { // Profiler stats table isn't thread-safe, so only enable this on the main thread - if (ThreadUtil::IsMainThread()) + if (Threading::IsMainThread()) { if (g_ScriptStatsTable) g_ScriptStatsTable->Add(this, debugName); @@ -381,7 +381,7 @@ ScriptInterface::~ScriptInterface() { - if (ThreadUtil::IsMainThread()) + if (Threading::IsMainThread()) { if (g_ScriptStatsTable) g_ScriptStatsTable->Remove(this); Index: ps/trunk/source/soundmanager/SoundManager.cpp =================================================================== --- ps/trunk/source/soundmanager/SoundManager.cpp +++ ps/trunk/source/soundmanager/SoundManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,6 +30,7 @@ #include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/Profiler2.h" +#include "ps/Threading.h" #include "ps/XML/Xeromyces.h" #include @@ -51,7 +52,7 @@ m_DeadItems = new ItemsList; m_Shutdown = false; - m_WorkerThread = std::thread(RunThread, this); + m_WorkerThread = std::thread(Threading::HandleExceptions::Wrapper, this); } ~CSoundManagerWorker() Index: ps/trunk/source/test_setup.cpp =================================================================== --- ps/trunk/source/test_setup.cpp +++ ps/trunk/source/test_setup.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -77,7 +77,7 @@ setlocale(LC_CTYPE, "UTF-8"); #endif - ThreadUtil::SetMainThread(); + Threading::SetMainThread(); g_Profiler2.Initialise(); m_ScriptEngine = new ScriptEngine; Index: ps/trunk/source/tools/atlas/GameInterface/GameLoop.cpp =================================================================== --- ps/trunk/source/tools/atlas/GameInterface/GameLoop.cpp +++ ps/trunk/source/tools/atlas/GameInterface/GameLoop.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -142,7 +142,7 @@ // TODO: delete all remaining messages, to avoid memory leak warnings // Restore main thread - ThreadUtil::SetMainThread(); + Threading::SetMainThread(); // Clean up AtlasView::DestroyViews();