mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
JACK backend: serialize all jack server calls with a mutex
As was noted in 88ee3af3ea it is unsafe/undefined behavior if two threads
sleep on the JACK request file descriptor, since there is no way to control
which one will wake and process the request. Since each thread may have
sent a different request, this can lead to a thread misinterpreting the
response because it is reading the wrong response.
This may (or may not) solve some subtle problems with JACK, but was
revealed by having a control surface (LaunchPad Pro) that registers
three ports from the butler thread at about the same as the GUI
thread is registering the auditioner. One thread read the wrong
response, and because of some slightly weird code/design, it attempts
to rename the port from within the response handler, which in JACK1
leads to deadlock (and later, zombification).
This commit is contained in:
parent
88ee3af3ea
commit
3c857a78c6
3 changed files with 80 additions and 61 deletions
|
|
@ -324,7 +324,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
|
||||
JACKSession* _session;
|
||||
|
||||
Glib::Threads::Mutex port_registration_mutex;
|
||||
mutable Glib::Threads::Mutex server_call_mutex;
|
||||
|
||||
protected:
|
||||
int _start (bool for_latency_measurement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue