summaryrefslogtreecommitdiff
path: root/libs/evoral/evoral/ControlList.hpp
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-04-15 18:13:56 +0200
committerRobin Gareus <robin@gareus.org>2015-04-15 18:13:56 +0200
commit96ce9c304e0a3e4a6b9882bbf1b831fbeaca6f11 (patch)
treeb8b20f36a0c0fefd0cd19137213119cdf016be21 /libs/evoral/evoral/ControlList.hpp
parent9391da0c24000ac479adc00a04a7ad7e197f2049 (diff)
Replace control list locks with RWLocks4.0-rc4
towards fixing #6238 and #6096. GUI thread: #2 Glib::Threads::Mutex::Lock::Lock #3 Evoral::ControlList::eval #4 Evoral::Control::get_double #5 ARDOUR::AutomationControl::get_value #6 ProcessorEntry::Control::control_changed .. #15 PBD::Timer::timeout_handler at the same time: Audio Thread (try-lock, fails) #0 Evoral::Curve::rt_safe_get_vector #1 ARDOUR::Amp::setup_gain_automation #2 ARDOUR::Route::process_output_buffers Due to the failed try-lock.. AMP::_apply_gain_automation is false. and Amp::run() uses a different gain factor. -> click.
Diffstat (limited to 'libs/evoral/evoral/ControlList.hpp')
-rw-r--r--libs/evoral/evoral/ControlList.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp
index 6353813097..7a828264bd 100644
--- a/libs/evoral/evoral/ControlList.hpp
+++ b/libs/evoral/evoral/ControlList.hpp
@@ -109,7 +109,7 @@ public:
EventList::size_type size() const { return _events.size(); }
double length() const {
- Glib::Threads::Mutex::Lock lm (_lock);
+ Glib::Threads::RWLock::ReaderLock lm (_lock);
return _events.empty() ? 0.0 : _events.back()->when;
}
bool empty() const { return _events.empty(); }
@@ -184,18 +184,18 @@ public:
std::pair<ControlList::iterator,ControlList::iterator> control_points_adjacent (double when);
template<class T> void apply_to_points (T& obj, void (T::*method)(const ControlList&)) {
- Glib::Threads::Mutex::Lock lm (_lock);
+ Glib::Threads::RWLock::WriterLock lm (_lock);
(obj.*method)(*this);
}
double eval (double where) {
- Glib::Threads::Mutex::Lock lm (_lock);
+ Glib::Threads::RWLock::ReaderLock lm (_lock);
return unlocked_eval (where);
}
double rt_safe_eval (double where, bool& ok) {
- Glib::Threads::Mutex::Lock lm (_lock, Glib::Threads::TRY_LOCK);
+ Glib::Threads::RWLock::ReaderLock lm (_lock, Glib::Threads::TRY_LOCK);
if ((ok = lm.locked())) {
return unlocked_eval (where);
@@ -226,7 +226,7 @@ public:
double default_value() const { return _default_value; }
// FIXME: const violations for Curve
- Glib::Threads::Mutex& lock() const { return _lock; }
+ Glib::Threads::RWLock& lock() const { return _lock; }
LookupCache& lookup_cache() const { return _lookup_cache; }
SearchCache& search_cache() const { return _search_cache; }
@@ -297,7 +297,7 @@ protected:
mutable LookupCache _lookup_cache;
mutable SearchCache _search_cache;
- mutable Glib::Threads::Mutex _lock;
+ mutable Glib::Threads::RWLock _lock;
Parameter _parameter;
ParameterDescriptor _desc;