Author: hokein Date: Mon Aug 20 02:07:59 2018 New Revision: 340156 URL: http://llvm.org/viewvc/llvm-project?rev=340156&view=rev Log: [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 Modified: clang-tools-extra/trunk/clangd/index/MemIndex.cpp Modified: clang-tools-extra/trunk/clangd/index/MemIndex.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/MemIndex.cpp?rev=340156&r1=340155&r2=340156&view=diff ============================================================================== --- clang-tools-extra/trunk/clangd/index/MemIndex.cpp (original) +++ clang-tools-extra/trunk/clangd/index/MemIndex.cpp Mon Aug 20 02:07:59 2018 @@ -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()) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits