Remove redundant synchronization for 'static' variable initialization

This commit is contained in:
Vittorio Romeo 2021-12-08 14:55:18 +00:00
parent 8be8a76cba
commit 3914bd0062

View File

@ -56,7 +56,6 @@
namespace
{
sf::Mutex maxTextureUnitsMutex;
sf::Mutex isAvailableMutex;
GLint checkMaxTextureUnits()
@ -70,11 +69,7 @@ namespace
// Retrieve the maximum number of texture units available
std::size_t getMaxTextureUnits()
{
// TODO: Remove this lock when it becomes unnecessary in C++11
sf::Lock lock(maxTextureUnitsMutex);
static GLint maxUnits = checkMaxTextureUnits();
return static_cast<std::size_t>(maxUnits);
}