[clangd] Add missing lock in the lookup.

Reviewers: ioeric

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D50960

llvm-svn: 340156
This commit is contained in:
Haojian Wu 2018-08-20 09:07:59 +00:00
parent 30ffdf42f7
commit 02465baea2
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ bool MemIndex::fuzzyFind(
void MemIndex::lookup(const LookupRequest &Req,
llvm::function_ref<void(const Symbol &)> Callback) const {
std::lock_guard<std::mutex> Lock(Mutex);
for (const auto &ID : Req.IDs) {
auto I = Index.find(ID);
if (I != Index.end())