summaryrefslogtreecommitdiff
path: root/libs/backends/alsa/alsa_audiobackend.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-01-14 22:07:51 +0100
committerRobin Gareus <robin@gareus.org>2019-01-14 22:33:31 +0100
commit8b71967be9c35213cb670d3057ffdd699fe23af3 (patch)
tree0537b648d8fc3bc9f1ef58c90e3ba5ad18b61f28 /libs/backends/alsa/alsa_audiobackend.h
parent8f9e63575fe527eb1cbeceda7565da189e00948b (diff)
ALSA: add locks to safely add/remove MIDI devices
Theoretically this could be lock-free by using a queue of device ports to be added/remove in sync in the process-callback, but realistically adding/removing devices doesn't have to be rt-safe.
Diffstat (limited to 'libs/backends/alsa/alsa_audiobackend.h')
-rw-r--r--libs/backends/alsa/alsa_audiobackend.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/backends/alsa/alsa_audiobackend.h b/libs/backends/alsa/alsa_audiobackend.h
index ef218b49a1..e04c72e561 100644
--- a/libs/backends/alsa/alsa_audiobackend.h
+++ b/libs/backends/alsa/alsa_audiobackend.h
@@ -393,6 +393,8 @@ class AlsaAudioBackend : public AudioBackend {
pthread_t _midi_device_thread_id;
bool _midi_device_thread_active;
+ pthread_mutex_t _device_port_mutex;
+
/* processing */
float _dsp_load;
ARDOUR::DSPLoadCalculator _dsp_load_calc;