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

2017-05-23 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL303634: [clangd] Replaced WorkerRequest with std::function... (authored by ibiryukov). Changed prior to commit: https://reviews.llvm.org/D33415?vs=99883&id=99900#toc Repository: rL LLVM https://revi

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

2017-05-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Looks good. https://reviews.llvm.org/D33415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/lis

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

2017-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
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 o

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

2017-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked 2 inline comments as done. ilya-biryukov added inline comments. Comment at: clangd/ClangdServer.cpp:85 +Request = std::move(RequestQueue.front()); +RequestQueue.pop_front(); } // unlock Mutex krasimir wrote: > Why are w

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

2017-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 99883. ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. Added more comments to addToEnd/addToFront, added explicit flush instead of relying on raw_ostream's destructor to do it implicitly. https://reviews.llvm.org/D33415

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

2017-05-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clangd/ClangdUnitStore.h:56 + template + void runOnExistingUnit(PathRef File, Func Action) { +std::lock_guard Lock(Mutex); krasimir wrote: > Maybe make it less generic and put the implementation in the source fil

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

2017-05-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clangd/ClangdServer.cpp:85 +Request = std::move(RequestQueue.front()); +RequestQueue.pop_front(); } // unlock Mutex Why are we taking it from the front and not from the back? Maybe at least add a