[clangd] Stop exposing Futures from ClangdServer operations.
authorSam McCall <sam.mccall@gmail.com>
Tue, 13 Feb 2018 08:59:23 +0000 (08:59 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 13 Feb 2018 08:59:23 +0000 (08:59 +0000)
commit0bb24cd4fabb15c4d17adb26db08bc1ef9de9920
treec31af4822cc9e55b1a92ea3ac5baf1decbddc5b1
parentf684c9c83c62b4b7552911f41eddb38552ec62d5
[clangd] Stop exposing Futures from ClangdServer operations.

Summary:
LSP has asynchronous semantics, being able to block on an async operation
completing is unneccesary and leads to tighter coupling with the threading.

In practice only tests depend on this, so we add a general-purpose "block until
idle" function to the scheduler which will work for all operations.

To get this working, fix a latent condition-variable bug in ASTWorker, and make
AsyncTaskRunner const-correct.

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 324990
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/ClangdServer.h
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/TUScheduler.h
clang-tools-extra/clangd/Threading.cpp
clang-tools-extra/clangd/Threading.h
clang-tools-extra/unittests/clangd/ClangdTests.cpp
clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
clang-tools-extra/unittests/clangd/ThreadingTests.cpp