From 88e38b2699a78ced4f7a434aa3873ed3d85743f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Dom=C3=ADnguez?= Date: Mon, 19 Aug 2024 07:39:50 +0200 Subject: [PATCH] Replace boost atomics with std version --- libs/ardour/ardour/step_sequencer.h | 1 - libs/ardour/ardour/transport_master.h | 21 ++++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libs/ardour/ardour/step_sequencer.h b/libs/ardour/ardour/step_sequencer.h index 6edfcdfd1e..9063a45e27 100644 --- a/libs/ardour/ardour/step_sequencer.h +++ b/libs/ardour/ardour/step_sequencer.h @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/libs/ardour/ardour/transport_master.h b/libs/ardour/ardour/transport_master.h index 16f141d469..8d2fc37166 100644 --- a/libs/ardour/ardour/transport_master.h +++ b/libs/ardour/ardour/transport_master.h @@ -20,7 +20,6 @@ #include -#include #include #include @@ -81,11 +80,11 @@ struct LIBARDOUR_API SafeTime { * complete and the values stored there are consistent. */ - boost::atomic guard1; - samplepos_t position; - samplepos_t timestamp; - double speed; - boost::atomic guard2; + std::atomic guard1; + samplepos_t position; + samplepos_t timestamp; + double speed; + std::atomic guard2; SafeTime () { @@ -107,11 +106,11 @@ struct LIBARDOUR_API SafeTime { void update (samplepos_t p, samplepos_t t, double s) { - guard1.fetch_add (1, boost::memory_order_acquire); + guard1.fetch_add (1, std::memory_order_acquire); position = p; timestamp = t; speed = s; - guard2.fetch_add (1, boost::memory_order_acquire); + guard2.fetch_add (1, std::memory_order_acquire); } void safe_read (SafeTime& dst) const @@ -124,14 +123,14 @@ struct LIBARDOUR_API SafeTime { Glib::usleep (20); tries = 0; } - dst.guard1.store (guard1.load (boost::memory_order_seq_cst), boost::memory_order_seq_cst); + dst.guard1.store (guard1.load (std::memory_order_seq_cst), std::memory_order_seq_cst); dst.position = position; dst.timestamp = timestamp; dst.speed = speed; - dst.guard2.store (guard2.load (boost::memory_order_seq_cst), boost::memory_order_seq_cst); + dst.guard2.store (guard2.load (std::memory_order_seq_cst), std::memory_order_seq_cst); tries++; - } while (dst.guard1.load (boost::memory_order_seq_cst) != dst.guard2.load (boost::memory_order_seq_cst)); + } while (dst.guard1.load (std::memory_order_seq_cst) != dst.guard2.load (std::memory_order_seq_cst)); } };