The Connect method can be called between Schedule and lock. In that case, when
locked, the state is already set to CONNECTING of READY and the condition won't
be signaled anymore.
---
 src/storage/plugins/NfsStorage.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/storage/plugins/NfsStorage.cxx 
b/src/storage/plugins/NfsStorage.cxx
index 6a3eeed..fc4fd5c 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -177,6 +177,8 @@ private:
                                mutex.unlock();
                                DeferredMonitor::Schedule();
                                mutex.lock();
+                               if (state == State::INITIAL)
+                                       cond.wait(mutex);
                                break;
 
                        case State::CONNECTING:
@@ -188,8 +190,6 @@ private:
                                error.Set(last_error);
                                return false;
                        }
-
-                       cond.wait(mutex);
                }
        }
 
-- 
2.1.4

_______________________________________________
mpd-devel mailing list
mpd-devel@musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to