diff --git a/Source/astcenc_internal.h b/Source/astcenc_internal.h index 4caf60d7211de3dcdbfc37d9c87580ad50eb6aa3..5c078137544b8fd58ca780594bcd2dd97557e959 100644 --- a/Source/astcenc_internal.h +++ b/Source/astcenc_internal.h @@ -30,6 +30,7 @@ #endif #include #include +#include #ifdef ASTC_CUSTOMIZED_ENABLE #include @@ -2309,6 +2310,7 @@ public: CustomizedBlockMode customizedBlockModeFunc_; bool LoadSutCustomizedSo() { + std::lock_guard lock(astcCustomizedSoMutex_); if (!astcCustomizedSoOpened_) { #if defined(_WIN32) && !defined(__CYGWIN__) @@ -2415,6 +2417,7 @@ private: #else void *astcCustomizedSoHandle_; #endif + std::mutex astcCustomizedSoMutex_; }; extern AstcCustomizedSoManager g_astcCustomizedSoManager; #endif