storage/nfs: use class ScopeUnlock

This commit is contained in:
Max Kellermann 2019-04-25 19:22:49 +02:00
parent 0e48747607
commit 84c406d5f5
1 changed files with 5 additions and 3 deletions

View File

@ -173,9 +173,11 @@ private:
switch (state) {
case State::INITIAL:
/* schedule connect */
mutex.unlock();
defer_connect.Schedule();
mutex.lock();
{
const ScopeUnlock unlock(mutex);
defer_connect.Schedule();
}
if (state == State::INITIAL)
cond.wait(mutex);
break;