pthread -> std::thread (3/7) - Replace pthread in other engine files
MapGenerator, TextureConverter, and some other files used pthread.
Differential Revision: https://code.wildfiregames.com/D1917
pthread -> std::thread (3/7) - Replace pthread in other engine files
Description
Details
Event TimelineComment Actions When compiling with clang 8.0.1: In file included from ../../../source/graphics/TextureConverter.cpp:20: ../../../source/graphics/TextureConverter.h:209:7: error: no type named 'mutex' in namespace 'std' std::mutex m_WorkerMutex; ~~~~~^ ../../../source/graphics/TextureConverter.cpp:289:6: warning: unused variable 'ret' [-Wunused-variable] int ret; ^ In file included from ../../../source/graphics/TextureConverter.cpp:20: ../../../source/graphics/TextureConverter.h:209:13: warning: private field 'm_WorkerMutex' is not used [-Wunused-private-field] std::mutex m_WorkerMutex; ^ 2 warnings and 1 error generated. make[1]: *** [graphics.make:350: obj/graphics_Release/TextureConverter.o] Error 1 make[1]: *** Waiting for unfinished jobs.... ICmpObstruction.cpp ICmpObstructionManager.cpp In file included from ../../../source/graphics/TextureManager.cpp:27: ../../../source/graphics/TextureConverter.h:209:7: error: no type named 'mutex' in namespace 'std' std::mutex m_WorkerMutex; ~~~~~^ 1 error generated. make[1]: *** [graphics.make:353: obj/graphics_Release/TextureManager.o] Error 1 make: *** [Makefile:115: graphics] Error 2 make: *** Waiting for unfinished jobs.... ../../../source/lib/timer.cpp:85:13: error: no type named 'mutex' in namespace 'std' static std::mutex ensure_monotonic_mutex; ~~~~~^ ../../../source/lib/timer.cpp:90:7: error: no member named 'lock_guard' in namespace 'std' std::lock_guard<std::mutex> lock(ensure_monotonic_mutex); ~~~~~^ ../../../source/lib/timer.cpp:90:23: error: no member named 'mutex' in namespace 'std' std::lock_guard<std::mutex> lock(ensure_monotonic_mutex); ~~~~~^
Comment Actions That commit breaks crash/exception handling on Windows. So any error happened in the std::thread aren't handled and reported. That must be fixed. Comment Actions As far as I can see, it's now fixed on Windows; Atlas still does weird things but that's not new. |