0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-26 08:01:51 +08:00

Remove ATOMIC_VAR_INIT

This commit is contained in:
Sergey Yagovtsev 2018-09-18 22:41:58 +03:00
parent 47f552fedb
commit 99b761375b
9 changed files with 31 additions and 31 deletions

View File

@ -400,7 +400,7 @@ inline profiler::block_index_t fillTreesFromFile(const char* filename, profiler:
bool gather_statistics,
std::ostream& _log)
{
std::atomic<int> progress = ATOMIC_VAR_INIT(0);
std::atomic<int> progress(0);
return fillTreesFromFile(progress, filename, begin_end_time, serialized_blocks, serialized_descriptors,
descriptors, _blocks, threaded_trees, bookmarks, descriptors_count, version, pid,
gather_statistics, _log);
@ -411,7 +411,7 @@ inline bool readDescriptionsFromStream(std::istream& str,
profiler::descriptors_list_t& descriptors,
std::ostream& _log)
{
std::atomic<int> progress = ATOMIC_VAR_INIT(0);
std::atomic<int> progress(0);
return readDescriptionsFromStream(progress, str, serialized_descriptors, descriptors, _log);
}

View File

@ -84,7 +84,7 @@ inline profiler::block_index_t writeTreesToFile(const char* filename,
profiler::processid_t pid,
std::ostream& log)
{
std::atomic<int> progress = ATOMIC_VAR_INIT(0);
std::atomic<int> progress(0);
return writeTreesToFile(progress, filename, serialized_descriptors, descriptors, descriptors_count, trees,
bookmarks, std::move(block_getter), begin_time, end_time, pid, log);
}
@ -101,7 +101,7 @@ inline profiler::block_index_t writeTreesToStream(std::ostream& str,
profiler::processid_t pid,
std::ostream& log)
{
std::atomic<int> progress = ATOMIC_VAR_INIT(0);
std::atomic<int> progress(0);
return writeTreesToStream(progress, str, serialized_descriptors, descriptors, descriptors_count, trees,
bookmarks, std::move(block_getter), begin_time, end_time, pid, log);
}

View File

@ -331,21 +331,21 @@ ProfileManager::ProfileManager() :
, m_beginTime(0)
, m_endTime(0)
{
m_profilerStatus = ATOMIC_VAR_INIT(false);
m_isEventTracingEnabled = ATOMIC_VAR_INIT(EASY_OPTION_EVENT_TRACING_ENABLED);
m_isAlreadyListening = ATOMIC_VAR_INIT(false);
m_stopDumping = ATOMIC_VAR_INIT(false);
m_stopListen = ATOMIC_VAR_INIT(false);
m_profilerStatus = false;
m_isEventTracingEnabled = EASY_OPTION_EVENT_TRACING_ENABLED;
m_isAlreadyListening = false;
m_stopDumping = false;
m_stopListen = false;
m_mainThreadId = ATOMIC_VAR_INIT(0);
m_frameMax = ATOMIC_VAR_INIT(0);
m_frameAvg = ATOMIC_VAR_INIT(0);
m_frameCur = ATOMIC_VAR_INIT(0);
m_frameMaxReset = ATOMIC_VAR_INIT(false);
m_frameAvgReset = ATOMIC_VAR_INIT(false);
m_mainThreadId = 0;
m_frameMax = 0;
m_frameAvg = 0;
m_frameCur = 0;
m_frameMaxReset = false;
m_frameAvgReset = false;
#if !defined(EASY_CHRONO_CLOCK) && !defined(_WIN32)
m_cpuFrequency = ATOMIC_VAR_INIT(1);
m_cpuFrequency = 1;
# if !defined(EASY_PROFILER_API_DISABLED)
const auto cpu_frequency = calculate_cpu_frequency();

View File

@ -193,8 +193,8 @@ ArbitraryValuesCollection::ArbitraryValuesCollection()
, m_chartType(ChartType::Regular)
, m_jobType(0)
{
m_status = ATOMIC_VAR_INIT(Idle);
m_bInterrupt = ATOMIC_VAR_INIT(false);
m_status = Idle;
m_bInterrupt = false;
}
ArbitraryValuesCollection::~ArbitraryValuesCollection()

View File

@ -72,7 +72,7 @@ GraphicsImageItem::GraphicsImageItem() : Parent(nullptr)
, m_timer(::std::bind(&This::onTimeout, this))
, m_bPermitImageUpdate(true)
{
m_bReady = ATOMIC_VAR_INIT(false);
m_bReady = false;
m_boundaryTimer.setInterval(BoundaryTimerInterval);
m_timer.setInterval(TimerInterval);
}

View File

@ -2835,13 +2835,13 @@ void DialogWithGeometry::restoreGeometry()
SocketListener::SocketListener() : m_receivedSize(0), m_port(0), m_regime(ListenerRegime::Idle)
{
m_bInterrupt = ATOMIC_VAR_INIT(false);
m_bConnected = ATOMIC_VAR_INIT(false);
m_bStopReceive = ATOMIC_VAR_INIT(false);
m_bFrameTimeReady = ATOMIC_VAR_INIT(false);
m_bCaptureReady = ATOMIC_VAR_INIT(false);
m_frameMax = ATOMIC_VAR_INIT(0);
m_frameAvg = ATOMIC_VAR_INIT(0);
m_bInterrupt = false;
m_bConnected = false;
m_bStopReceive = false;
m_bFrameTimeReady = false;
m_bCaptureReady = false;
m_frameMax = 0;
m_frameAvg = 0;
}
SocketListener::~SocketListener()

View File

@ -53,7 +53,7 @@
ThreadPoolTask::ThreadPoolTask() : m_func([]{}), m_interrupt(nullptr)
{
m_status = ATOMIC_VAR_INIT(static_cast<int8_t>(TaskStatus::Finished));
m_status = static_cast<int8_t>(TaskStatus::Finished);
}
ThreadPoolTask::~ThreadPoolTask()

View File

@ -70,9 +70,9 @@
//////////////////////////////////////////////////////////////////////////
TreeWidgetLoader::TreeWidgetLoader()
: m_bDone(ATOMIC_VAR_INIT(false))
, m_bInterrupt(ATOMIC_VAR_INIT(false))
, m_progress(ATOMIC_VAR_INIT(0))
: m_bDone(false)
, m_bInterrupt(false)
, m_progress(0)
, m_mode(TreeMode::Full)
{
}

View File

@ -269,7 +269,7 @@ int main(int argc, char* argv[])
cv.notify_all();
#ifndef SAMPLE_NETWORK_TEST
std::atomic_bool stop = ATOMIC_VAR_INIT(false);
std::atomic_bool stop(false);
auto frame_time_printer_thread = std::thread([&stop]()
{
while (!stop.load(std::memory_order_acquire))