From 661536e6f63e4be9363031d0bbd47ef4769c5130 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Sun, 22 May 2022 20:59:37 -0700 Subject: [PATCH] use scoped lock --- quicktex/s3tc/bc1/OrderTable.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/quicktex/s3tc/bc1/OrderTable.h b/quicktex/s3tc/bc1/OrderTable.h index 6d4b564..d24cf10 100644 --- a/quicktex/s3tc/bc1/OrderTable.h +++ b/quicktex/s3tc/bc1/OrderTable.h @@ -58,7 +58,7 @@ template class OrderTable { static bool Generate() { static_assert(N == 4 || N == 3); - table_mutex.lock(); + std::scoped_lock{table_mutex}; if (!generated) { hashes = new std::array(); factors = new std::array(); @@ -85,8 +85,6 @@ template class OrderTable { generated = true; } - table_mutex.unlock(); - assert(generated); return true; }