force execution of ARDOUR::init_post_engine() before any handlers of AudioEngine::Running()

This commit is contained in:
Paul Davis 2019-01-27 14:02:03 -07:00
parent e7b34d7f18
commit 64ed049567
2 changed files with 14 additions and 4 deletions

View File

@ -39,6 +39,7 @@
#include "midi++/mmc.h"
#include "ardour/async_midi_port.h"
#include "ardour/ardour.h"
#include "ardour/audio_port.h"
#include "ardour/audio_backend.h"
#include "ardour/audioengine.h"
@ -930,10 +931,22 @@ AudioEngine::start (bool for_latency)
PortManager::fill_midi_port_info ();
if (!for_latency) {
/* Call the library-wide ::init_post_engine() before emitting
* running to ensure that its tasks are complete before any
* signal handlers execute. PBD::Signal does not ensure
* ordering of signal handlers so even if ::init_post_engine()
* is connected first, it may not run first.
*/
ARDOUR::init_post_engine (_start_cnt);
Running (_start_cnt); /* EMIT SIGNAL */
/* latency start/stop cycles do not count as "starts" */
_start_cnt++;
}
_start_cnt++;
return 0;
}

View File

@ -561,9 +561,6 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
ARDOUR::AudioEngine::create ();
/* This will run in whatever thread calls AudioEngine::start() */
ARDOUR::AudioEngine::instance()->Running.connect_same_thread (engine_startup_connection, ARDOUR::init_post_engine);
/* it is unfortunate that we need to include reserved names here that
refer to control surfaces. But there's no way to ensure a complete
lack of collisions without doing this, since the control surface