OSDN Git Service

[clangd] Fix race in Global CDB shutdown
authorSam McCall <sam.mccall@gmail.com>
Tue, 2 Feb 2021 14:20:18 +0000 (15:20 +0100)
committerTom Stellard <tstellar@redhat.com>
Wed, 17 Feb 2021 00:58:17 +0000 (16:58 -0800)
commitf23ee06ec27e991f9f1fbb646f3a2288aeedee71
tree3635ea7ef95f795fc3ed61d8ad0863af0e621f90
parentfa9dc0c60cbc25b9fc4c6c5ff5f4ba81c7a612b4
[clangd] Fix race in Global CDB shutdown

I believe the atomic write can be reordered after the notify, and that
seems to be happening on mac m1: http://45.33.8.238/macm1/2654/step_8.txt
In practice maybe seq_cst is enough? But no reason not to lock here.

https://bugs.llvm.org/show_bug.cgi?id=48998
(cherry picked from commit 6ac3fd9706047304c52a678884122a3a6bc55432)
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp