#ifndef MYX_BASE_PATHS_MT_CPP_ #define MYX_BASE_PATHS_MT_CPP_ #ifndef MYXLIB_HEADER_ONLY #include #else #pragma once #endif #include #include #include #include #include namespace myx { namespace filesystem { MYXLIB_INLINE PathsMT::PathsMT() = default; MYXLIB_INLINE PathsMT& PathsMT::instance() { volatile PathsMT* localInstance = sInstance.load( std::memory_order_acquire ); if ( localInstance == nullptr ) { std::lock_guard< std::mutex > myLock( sMutex ); localInstance = sInstance.load( std::memory_order_relaxed ); if ( localInstance == nullptr ) // -V1036 { localInstance = new PathsMT(); sInstance.store( const_cast< PathsMT* >( localInstance ), std::memory_order_release ); // NOLINT } } return( const_cast< PathsMT& >( *localInstance ) ); // NOLINT } } // namespace filesystem } // namespace myx #endif // MYX_BASE_PATHS_MT_CPP_