diff --git a/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp b/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp --- a/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp +++ b/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp @@ -132,8 +132,10 @@ } else { ExpectedInitial.erase(It); } - if (result()) + if (result()) { + L.unlock(); ResultIsReady.notify_one(); + } } void consumeNonInitial(DirectoryWatcher::Event E) { @@ -151,8 +153,10 @@ } else { ExpectedNonInitial.erase(It); } - if (result()) + if (result()) { + L.unlock(); ResultIsReady.notify_one(); + } } // This method is used by DirectoryWatcher.