CoreAudio/MIDI: add locks for port-registration

CoreMIDI ports are dynamic. When dis/connecting a device CoreAudio's
AudioHardware-PropertyListener triggers a callback which can
add/remove ports.

This can not happen concurrently with processing, but it may happen
concurrently with a user creating tracks using Ardour's UI
and/or session-load/setup.
This commit is contained in:
Robin Gareus 2018-03-29 18:15:20 +02:00
parent 5132a6c2eb
commit 37df98d0af
2 changed files with 9 additions and 0 deletions

View file

@ -485,6 +485,7 @@ class CoreAudioBackend : public AudioBackend {
std::vector<PortConnectData *> _port_connection_queue;
pthread_mutex_t _port_callback_mutex;
pthread_mutex_t _port_registration_mutex;
bool _port_change_flag;
void port_connect_callback (const std::string& a, const std::string& b, bool conn) {