Fix deadlocks on MIDI record.

More locking than is strictly necessary, but the assertion in MidiModel::write_lock is a nice check, at least for now...


git-svn-id: svn://localhost/ardour2/branches/3.0@5868 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-10-22 20:37:24 +00:00
parent 20eb826764
commit 11f448917f
3 changed files with 21 additions and 5 deletions

View file

@ -362,6 +362,7 @@ SMFSource::set_state (const XMLNode& node, int version)
void
SMFSource::mark_streaming_midi_write_started (NoteMode mode, sframes_t start_frame)
{
Glib::Mutex::Lock lm (_lock);
MidiSource::mark_streaming_midi_write_started (mode, start_frame);
Evoral::SMF::begin_write ();
_last_ev_time_beats = 0.0;
@ -371,6 +372,7 @@ SMFSource::mark_streaming_midi_write_started (NoteMode mode, sframes_t start_fra
void
SMFSource::mark_streaming_write_completed ()
{
Glib::Mutex::Lock lm (_lock);
MidiSource::mark_streaming_write_completed();
if (!writable()) {