Replace control list locks with RWLocks

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.
This commit is contained in:
Robin Gareus 2015-04-15 18:13:56 +02:00
parent 9391da0c24
commit 96ce9c304e
3 changed files with 32 additions and 32 deletions

View file

@ -171,7 +171,7 @@ Curve::solve ()
bool
Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen)
{
Glib::Threads::Mutex::Lock lm(_list.lock(), Glib::Threads::TRY_LOCK);
Glib::Threads::RWLock::ReaderLock lm(_list.lock(), Glib::Threads::TRY_LOCK);
if (!lm.locked()) {
return false;
@ -184,7 +184,7 @@ Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen)
void
Curve::get_vector (double x0, double x1, float *vec, int32_t veclen)
{
Glib::Threads::Mutex::Lock lm(_list.lock());
Glib::Threads::RWLock::ReaderLock lm(_list.lock());
_get_vector (x0, x1, vec, veclen);
}