diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-10-15 15:12:02 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-10-15 18:44:22 -0400 |
commit | ab658d7ca15ed24e073d85f43376c986c659b1cf (patch) | |
tree | 7a38bebe265d55d4d51da027c7051ad3100c03fa /libs/evoral/evoral/SMF.hpp | |
parent | 7e764ea4051dce1f687cc9bdf92c67c110517600 (diff) |
add mutex/lock to all Evoral::SMF methods that use _smf/libsmf, to avoid inadvertent corruption via multithreaded access.
Serialization of Session::save_state() will already protect against most of this, but there is really no
good reason why Evoral::SMF's API should require single-threaded/explicit serialization.
Diffstat (limited to 'libs/evoral/evoral/SMF.hpp')
-rw-r--r-- | libs/evoral/evoral/SMF.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp index 5b04e277b9..b851cf6b64 100644 --- a/libs/evoral/evoral/SMF.hpp +++ b/libs/evoral/evoral/SMF.hpp @@ -22,6 +22,8 @@ #include <cassert> +#include <glibmm/threads.h> + #include "evoral/visibility.h" #include "evoral/types.hpp" @@ -85,6 +87,7 @@ private: smf_t* _smf; smf_track_t* _smf_track; bool _empty; ///< true iff file contains(non-empty) events + mutable Glib::Threads::Mutex _smf_lock; }; }; /* namespace Evoral */ |