Fix hanging when creating more than 2 BC1Encoders

This commit is contained in:
Andrew Cassidy 2021-03-07 00:52:45 -08:00
parent 5056e07f37
commit e58871167e

View File

@ -56,8 +56,7 @@ template <size_t N> class OrderTable {
static_assert(N == 4 || N == 3);
table_mutex.lock();
if (generated) return false;
if (!generated) {
hashes = new std::array<Hash, HashCount>();
factors = new std::array<Vector4, OrderCount>();
@ -82,6 +81,7 @@ template <size_t N> class OrderTable {
}
generated = true;
}
table_mutex.unlock();
assert(generated);
@ -145,4 +145,4 @@ template <> const OrderTable<4>::BestOrderArray OrderTable<4>::BestOrders;
extern template class OrderTable<3>;
extern template class OrderTable<4>;
} // namespace rgbcx
} // namespace rgbcx::BC1