Обновление подмодулей

This commit is contained in:
2020-05-06 17:59:39 +03:00
parent 00be8cd00f
commit 87f4c854d8
11 changed files with 20 additions and 32 deletions

View File

@@ -21,7 +21,7 @@ namespace filesystem {
MYXLIB_INLINE Paths::Paths() = default;
MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType()
MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType() // V2008
{
QRegExp binUnityRegexp( "/s*bin/unity$" );
QRegExp binRegexp( "/s*bin$" );

View File

@@ -102,8 +102,8 @@ public:
*/
static Paths& instance()
{
static Paths p;
return( p );
static Paths sPaths;
return( sPaths );
}

View File

@@ -23,15 +23,15 @@ MYXLIB_INLINE PathsMT::PathsMT() = default;
MYXLIB_INLINE PathsMT& PathsMT::instance()
{
volatile PathsMT* localInstance = mInstance.load( std::memory_order_acquire );
volatile PathsMT* localInstance = sInstance.load( std::memory_order_acquire );
if ( localInstance == nullptr )
{
std::lock_guard< std::mutex > myLock( mMutex );
localInstance = mInstance.load( std::memory_order_relaxed );
std::lock_guard< std::mutex > myLock( sMutex );
localInstance = sInstance.load( std::memory_order_relaxed );
if ( localInstance == nullptr ) // -V1036
{
localInstance = new PathsMT();
mInstance.store( const_cast< PathsMT* >( localInstance ), std::memory_order_release ); // NOLINT
sInstance.store( const_cast< PathsMT* >( localInstance ), std::memory_order_release ); // NOLINT
}
}
return( const_cast< PathsMT& >( *localInstance ) ); // NOLINT

View File

@@ -31,8 +31,8 @@ class PathsMT : public Paths
PathsMT();
~PathsMT() = default;
static std::atomic< PathsMT* > mInstance;
static std::mutex mMutex;
static std::atomic< PathsMT* > sInstance;
static std::mutex sMutex;
public: