diff --git a/Source/astcenc_internal.h b/Source/astcenc_internal.h index 93f54d9..2cf2320 100644 --- a/Source/astcenc_internal.h +++ b/Source/astcenc_internal.h @@ -30,6 +30,7 @@ #endif #include #include +#include #ifdef ASTC_CUSTOMIZED_ENABLE #include @@ -2306,6 +2307,7 @@ public: CustomizedBlockMode customizedBlockModeFunc_; bool LoadSutCustomizedSo() { + std::lock_guard lock(astcCustomizedSoMutex_); if (!astcCustomizedSoOpened_) { #if defined(_WIN32) && !defined(__CYGWIN__) @@ -2412,6 +2414,7 @@ private: #else void *astcCustomizedSoHandle_; #endif + std::mutex astcCustomizedSoMutex_; }; extern AstcCustomizedSoManager g_astcCustomizedSoManager; #endif