diff options
Diffstat (limited to 'tools/gfx-unit-test/precompiled-module-cache.cpp')
| -rw-r--r-- | tools/gfx-unit-test/precompiled-module-cache.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/gfx-unit-test/precompiled-module-cache.cpp b/tools/gfx-unit-test/precompiled-module-cache.cpp index 8c22a7c84..778c68a89 100644 --- a/tools/gfx-unit-test/precompiled-module-cache.cpp +++ b/tools/gfx-unit-test/precompiled-module-cache.cpp @@ -7,6 +7,7 @@ #include "slang-gfx.h" #include "unit-test/slang-unit-test.h" +#include <mutex> using namespace gfx; namespace gfx_test @@ -15,6 +16,9 @@ namespace gfx_test Slang::ComPtr<slang::ISession> createSession(gfx::IDevice* device, ISlangFileSystemExt* fileSys) { + static std::mutex m; + std::lock_guard<std ::mutex> lock(m); + Slang::ComPtr<slang::ISession> slangSession; device->getSlangSession(slangSession.writeRef()); slang::SessionDesc sessionDesc = {}; |
