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

@ -461,7 +461,7 @@ DummyAudioBackend::_start (bool /*for_latency_measurement*/)
}
engine.reconnect_ports ();
g_atomic_int_set (&_port_change_flag, 0);
_port_change_flag.store (0);
if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) {
PBD::error << _("DummyAudioBackend: cannot start.") << endmsg;
@ -1008,7 +1008,8 @@ DummyAudioBackend::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 ()) {