#include #include #include #include #include #include namespace myx { namespace filesystem { PathsMT::PathsMT() = default; PathsMT& PathsMT::instance() { volatile PathsMT* localInstance = mInstance.load( std::memory_order_acquire ); if ( localInstance == nullptr ) { std::lock_guard< std::mutex > myLock( mMutex ); localInstance = mInstance.load( std::memory_order_relaxed ); if ( localInstance == nullptr ) // -V1036 { localInstance = new PathsMT(); mInstance.store( const_cast< PathsMT* >( localInstance ), std::memory_order_release ); // NOLINT } } return( const_cast< PathsMT& >( *localInstance ) ); // NOLINT } } // namespace filesystem } // namespace myx