switch from glib atomic to std::atomic (libs edition)

This commit is contained in:
Paul Davis 2023-02-17 00:31:21 -07:00
parent d7922738f0
commit 4ba4cd69ff
77 changed files with 630 additions and 603 deletions

View file

@ -618,7 +618,7 @@ PulseAudioBackend::_start (bool /*for_latency_measurement*/)
engine.reconnect_ports ();
_run = true;
g_atomic_int_set (&_port_change_flag, 0);
_port_change_flag.store (0);
if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC,
&_main_thread, pthread_process, this)) {
@ -1091,7 +1091,8 @@ PulseAudioBackend::main_process_thread ()
bool connections_changed = false;
bool ports_changed = false;
if (!pthread_mutex_trylock (&_port_callback_mutex)) {
if (g_atomic_int_compare_and_exchange (&_port_change_flag, 1, 0)) {
int canderef (1);
if (_port_change_flag.compare_exchange_strong (canderef, 0)) {
ports_changed = true;
}
if (!_port_connection_queue.empty ()) {