Don't use trylock in assertions on windows as it will fail
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 13 Jul 2013 20:57:04 +0000 (16:57 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 13 Jul 2013 20:57:04 +0000 (16:57 -0400)
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.

libs/ardour/io.cc
libs/ardour/port_insert.cc
libs/ardour/route.cc

index cdb8a4693cbb39cb0cdd5a0f0c7bf875b4bc7a69..4e080b06d86953de5ddc0ef7be1edcec155481f0 100644 (file)
@@ -395,7 +395,9 @@ IO::disconnect (void* src)
 int
 IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed)
 {
+#ifndef WIN32
        assert (!AudioEngine::instance()->process_lock().trylock());
+#endif
 
        boost::shared_ptr<Port> port;
 
@@ -466,7 +468,9 @@ IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed)
 int
 IO::ensure_ports (ChanCount count, bool clear, void* src)
 {
+#ifndef WIN32
        assert (!AudioEngine::instance()->process_lock().trylock());
+#endif
 
        bool changed = false;
 
@@ -501,7 +505,9 @@ IO::ensure_ports (ChanCount count, bool clear, void* src)
 int
 IO::ensure_io (ChanCount count, bool clear, void* src)
 {
+#ifndef WIN32
        assert (!AudioEngine::instance()->process_lock().trylock());
+#endif
 
        return ensure_ports (count, clear, src);
 }
index c13927449ad9df8e68120c3552bfd66e3cb13297..cf33f1b9329e3b3943776de215bf82e88d7c52b1 100644 (file)
@@ -250,7 +250,9 @@ PortInsert::signal_latency() const
 bool
 PortInsert::configure_io (ChanCount in, ChanCount out)
 {
+#ifndef WIN32
        assert (!AudioEngine::instance()->process_lock().trylock());
+#endif
 
        /* for an insert, processor input corresponds to IO output, and vice versa */
 
index e87cb4b03fad3bb86e171c163445baa95df144a6..c6f588a79cfb120a02675896a5739310bb4fa4dd 100644 (file)
@@ -1612,7 +1612,9 @@ Route::reset_instrument_info ()
 int
 Route::configure_processors (ProcessorStreams* err)
 {
+#ifndef WIN32
        assert (!AudioEngine::instance()->process_lock().trylock());
+#endif
 
        if (!_in_configure_processors) {
                Glib::Threads::RWLock::WriterLock lm (_processor_lock);
@@ -1682,7 +1684,9 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err)
 int
 Route::configure_processors_unlocked (ProcessorStreams* err)
 {
+#ifndef WIN32
        assert (!AudioEngine::instance()->process_lock().trylock());
+#endif
 
        if (_in_configure_processors) {
                return 0;