Правки анализаторов
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
#include <myx/filesystem/current_executable.hpp>
|
||||
|
||||
#include <paths.h>
|
||||
#include <QString>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
|
||||
namespace myx {
|
||||
|
||||
|
@@ -3,17 +3,15 @@
|
||||
#include <myx/filesystem/paths.hpp>
|
||||
|
||||
#include <paths.h>
|
||||
#include <QString>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
|
||||
namespace myx {
|
||||
|
||||
namespace filesystem {
|
||||
|
||||
Paths::Paths()
|
||||
{
|
||||
}
|
||||
|
||||
Paths::Paths() = default;
|
||||
|
||||
Paths::HierarchyType Paths::getHierarchyType()
|
||||
{
|
||||
|
@@ -83,8 +83,8 @@ class Paths
|
||||
|
||||
HierarchyType getHierarchyType();
|
||||
|
||||
static std::atomic< Paths* > m_instance;
|
||||
static std::mutex m_mutex;
|
||||
static std::atomic< Paths* > mInstance;
|
||||
static std::mutex mMutex;
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -93,15 +93,15 @@ public:
|
||||
*/
|
||||
static Paths* getInstance()
|
||||
{
|
||||
Paths* localInstance = m_instance.load( std::memory_order_acquire );
|
||||
Paths* localInstance = mInstance.load( std::memory_order_acquire );
|
||||
if ( !localInstance )
|
||||
{
|
||||
std::lock_guard< std::mutex > myLock( m_mutex );
|
||||
localInstance = m_instance.load( std::memory_order_relaxed );
|
||||
std::lock_guard< std::mutex > myLock( mMutex );
|
||||
localInstance = mInstance.load( std::memory_order_relaxed );
|
||||
if ( !localInstance )
|
||||
{
|
||||
localInstance = new Paths();
|
||||
m_instance.store( localInstance, std::memory_order_release );
|
||||
mInstance.store( localInstance, std::memory_order_release );
|
||||
}
|
||||
}
|
||||
return( localInstance );
|
||||
|
Reference in New Issue
Block a user