std::atomic - 2nd batch of changes to convert from glib to std::atomic

This commit is contained in:
Paul Davis 2023-02-17 11:34:35 -07:00
parent c304edd253
commit a486fba3e9
30 changed files with 179 additions and 233 deletions

View file

@ -1265,7 +1265,8 @@ CoreAudioBackend::pre_process ()
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 ()) {