13
0

Don't use trylock in assertions on windows as it will fail

glib uses TryEnterCriticalSection on windows which will return true
if the lock as able to be locked *or* is already locked by the current
thread.
This commit is contained in:
Paul Davis 2013-07-13 16:57:04 -04:00
parent 1fd2412f5b
commit 6542ce76d0
3 changed files with 12 additions and 0 deletions

View File

@ -395,7 +395,9 @@ IO::disconnect (void* src)
int int
IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed) IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed)
{ {
#ifndef WIN32
assert (!AudioEngine::instance()->process_lock().trylock()); assert (!AudioEngine::instance()->process_lock().trylock());
#endif
boost::shared_ptr<Port> port; boost::shared_ptr<Port> port;
@ -466,7 +468,9 @@ IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed)
int int
IO::ensure_ports (ChanCount count, bool clear, void* src) IO::ensure_ports (ChanCount count, bool clear, void* src)
{ {
#ifndef WIN32
assert (!AudioEngine::instance()->process_lock().trylock()); assert (!AudioEngine::instance()->process_lock().trylock());
#endif
bool changed = false; bool changed = false;
@ -501,7 +505,9 @@ IO::ensure_ports (ChanCount count, bool clear, void* src)
int int
IO::ensure_io (ChanCount count, bool clear, void* src) IO::ensure_io (ChanCount count, bool clear, void* src)
{ {
#ifndef WIN32
assert (!AudioEngine::instance()->process_lock().trylock()); assert (!AudioEngine::instance()->process_lock().trylock());
#endif
return ensure_ports (count, clear, src); return ensure_ports (count, clear, src);
} }

View File

@ -250,7 +250,9 @@ PortInsert::signal_latency() const
bool bool
PortInsert::configure_io (ChanCount in, ChanCount out) PortInsert::configure_io (ChanCount in, ChanCount out)
{ {
#ifndef WIN32
assert (!AudioEngine::instance()->process_lock().trylock()); assert (!AudioEngine::instance()->process_lock().trylock());
#endif
/* for an insert, processor input corresponds to IO output, and vice versa */ /* for an insert, processor input corresponds to IO output, and vice versa */

View File

@ -1612,7 +1612,9 @@ Route::reset_instrument_info ()
int int
Route::configure_processors (ProcessorStreams* err) Route::configure_processors (ProcessorStreams* err)
{ {
#ifndef WIN32
assert (!AudioEngine::instance()->process_lock().trylock()); assert (!AudioEngine::instance()->process_lock().trylock());
#endif
if (!_in_configure_processors) { if (!_in_configure_processors) {
Glib::Threads::RWLock::WriterLock lm (_processor_lock); Glib::Threads::RWLock::WriterLock lm (_processor_lock);
@ -1682,7 +1684,9 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err)
int int
Route::configure_processors_unlocked (ProcessorStreams* err) Route::configure_processors_unlocked (ProcessorStreams* err)
{ {
#ifndef WIN32
assert (!AudioEngine::instance()->process_lock().trylock()); assert (!AudioEngine::instance()->process_lock().trylock());
#endif
if (_in_configure_processors) { if (_in_configure_processors) {
return 0; return 0;