[PATCH] D33415: [clangd] Replaced WorkerRequest with std::function...

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 04:56:56 PDT 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdServer.cpp:102
   } // unlock Mutex
+  RequestCV.notify_one();
   Worker.join();
----------------
krasimir wrote:
> Why did this get out?
"The notifying thread does not need to hold the lock on the same mutex as the one held by the waiting thread(s); in fact doing so is a pessimization, since the notified thread would immediately block again, waiting for the notifying thread to release the lock"
(from: http://en.cppreference.com/w/cpp/thread/condition_variable/notify_one)



https://reviews.llvm.org/D33415





More information about the cfe-commits mailing list