take process lock when adding processors:
authorRobin Gareus <robin@gareus.org>
Sun, 12 Jan 2014 20:47:15 +0000 (21:47 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 13 Jan 2014 14:39:18 +0000 (09:39 -0500)
commitac8eb0581da2e7ef7faceba4947c393496d3a530
tree990e136de7e21627f6e8768dcb35324683f2b2de
parentac8e258e15035fc44ed857d3424f560f0b317326
take process lock when adding processors:

fixes possible crash if a processor modifies port-count

1. a processor is inserted and activated with processor-lock held
2. only after that the process_lock() is taken, configure_processors() is called which reconfigures-IO

BUT if the processor that is inserted changes the channel count AND audio is processed before IOs are reconfigured
 -> possible crash (invalid port-buffers)

To reproduce: Bus1 (2in, 3out), Bus2 (2in, 3out)
- add a send from Bus1 to Bus2,
- then add a processor to Bus1, just before the send which
  increases the channel-count to 4 -> occasional crash or assert.
libs/ardour/route.cc