diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-09 10:18:28 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-09 10:18:28 -0400 |
commit | 1fd4d40dbbb426d32701f42809f4b33a5659aac4 (patch) | |
tree | a264099dd83c30839ab7f37335491ba6badf67a9 /libs/ardour/session_state.cc | |
parent | 7364ca213ae531870e198752661f2bbe1fbe8d9a (diff) |
add mutex to prevent concurrent session state saves.
Why wasn't this done 10 years ago?
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 4e99c663f0..42344ea7fd 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -665,6 +665,10 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot XMLTree tree; std::string xml_path(_session_dir->root_path()); + /* prevent concurrent saves from different threads */ + + Glib::Threads::Mutex::Lock lm (save_state_lock); + if (!_writable || (_state_of_the_state & CannotSave)) { return 1; } |