mirror of
https://github.com/drewcassidy/quicktex.git
synced 2024-09-13 06:37:34 +00:00
use scoped lock
This commit is contained in:
parent
920059bea1
commit
661536e6f6
@ -58,7 +58,7 @@ template <size_t N> class OrderTable {
|
|||||||
static bool Generate() {
|
static bool Generate() {
|
||||||
static_assert(N == 4 || N == 3);
|
static_assert(N == 4 || N == 3);
|
||||||
|
|
||||||
table_mutex.lock();
|
std::scoped_lock{table_mutex};
|
||||||
if (!generated) {
|
if (!generated) {
|
||||||
hashes = new std::array<Hash, HashCount>();
|
hashes = new std::array<Hash, HashCount>();
|
||||||
factors = new std::array<Vector4, OrderCount>();
|
factors = new std::array<Vector4, OrderCount>();
|
||||||
@ -85,8 +85,6 @@ template <size_t N> class OrderTable {
|
|||||||
|
|
||||||
generated = true;
|
generated = true;
|
||||||
}
|
}
|
||||||
table_mutex.unlock();
|
|
||||||
|
|
||||||
assert(generated);
|
assert(generated);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user