diff --git a/easy_profiler_core/include/easy/reader.h b/easy_profiler_core/include/easy/reader.h index f682b11..38ec906 100644 --- a/easy_profiler_core/include/easy/reader.h +++ b/easy_profiler_core/include/easy/reader.h @@ -400,7 +400,7 @@ inline profiler::block_index_t fillTreesFromFile(const char* filename, profiler: bool gather_statistics, std::ostream& _log) { - std::atomic progress = ATOMIC_VAR_INIT(0); + std::atomic 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 progress = ATOMIC_VAR_INIT(0); + std::atomic progress(0); return readDescriptionsFromStream(progress, str, serialized_descriptors, descriptors, _log); } diff --git a/easy_profiler_core/include/easy/writer.h b/easy_profiler_core/include/easy/writer.h index 749db5d..4ec1084 100644 --- a/easy_profiler_core/include/easy/writer.h +++ b/easy_profiler_core/include/easy/writer.h @@ -84,7 +84,7 @@ inline profiler::block_index_t writeTreesToFile(const char* filename, profiler::processid_t pid, std::ostream& log) { - std::atomic progress = ATOMIC_VAR_INIT(0); + std::atomic 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 progress = ATOMIC_VAR_INIT(0); + std::atomic progress(0); return writeTreesToStream(progress, str, serialized_descriptors, descriptors, descriptors_count, trees, bookmarks, std::move(block_getter), begin_time, end_time, pid, log); } diff --git a/easy_profiler_core/profile_manager.cpp b/easy_profiler_core/profile_manager.cpp index 589b4d5..3fe302d 100644 --- a/easy_profiler_core/profile_manager.cpp +++ b/easy_profiler_core/profile_manager.cpp @@ -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(); diff --git a/profiler_gui/arbitrary_value_inspector.cpp b/profiler_gui/arbitrary_value_inspector.cpp index 424f712..0981c4b 100644 --- a/profiler_gui/arbitrary_value_inspector.cpp +++ b/profiler_gui/arbitrary_value_inspector.cpp @@ -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() diff --git a/profiler_gui/graphics_image_item.cpp b/profiler_gui/graphics_image_item.cpp index 0a3d937..b46a396 100644 --- a/profiler_gui/graphics_image_item.cpp +++ b/profiler_gui/graphics_image_item.cpp @@ -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); } diff --git a/profiler_gui/main_window.cpp b/profiler_gui/main_window.cpp index ed35118..856fa98 100644 --- a/profiler_gui/main_window.cpp +++ b/profiler_gui/main_window.cpp @@ -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() diff --git a/profiler_gui/thread_pool_task.cpp b/profiler_gui/thread_pool_task.cpp index 1efcde7..edf743a 100644 --- a/profiler_gui/thread_pool_task.cpp +++ b/profiler_gui/thread_pool_task.cpp @@ -53,7 +53,7 @@ ThreadPoolTask::ThreadPoolTask() : m_func([]{}), m_interrupt(nullptr) { - m_status = ATOMIC_VAR_INIT(static_cast(TaskStatus::Finished)); + m_status = static_cast(TaskStatus::Finished); } ThreadPoolTask::~ThreadPoolTask() diff --git a/profiler_gui/tree_widget_loader.cpp b/profiler_gui/tree_widget_loader.cpp index c710891..3dae2e0 100644 --- a/profiler_gui/tree_widget_loader.cpp +++ b/profiler_gui/tree_widget_loader.cpp @@ -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) { } diff --git a/sample/main.cpp b/sample/main.cpp index 5b269b4..31f0a8d 100644 --- a/sample/main.cpp +++ b/sample/main.cpp @@ -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))