File tree 3 files changed +15
-15
lines changed
3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 31
31
#include " Protocol.h"
32
32
#include " Quality.h"
33
33
#include " SourceCode.h"
34
- #include " TUScheduler .h"
34
+ #include " Threading .h"
35
35
#include " Trace.h"
36
36
#include " URI.h"
37
37
#include " index/Index.h"
Original file line number Diff line number Diff line change 20
20
#include " llvm/ADT/STLExtras.h"
21
21
#include " llvm/ADT/StringMap.h"
22
22
#include " llvm/ADT/StringRef.h"
23
- #include < future>
24
23
25
24
namespace clang {
26
25
namespace clangd {
@@ -259,19 +258,6 @@ class TUScheduler {
259
258
std::chrono::steady_clock::duration UpdateDebounce;
260
259
};
261
260
262
- // / Runs \p Action asynchronously with a new std::thread. The context will be
263
- // / propagated.
264
- template <typename T>
265
- std::future<T> runAsync (llvm::unique_function<T()> Action) {
266
- return std::async (
267
- std::launch::async,
268
- [](llvm::unique_function<T ()> &&Action, Context Ctx) {
269
- WithContext WithCtx (std::move (Ctx));
270
- return Action ();
271
- },
272
- std::move (Action), Context::current ().clone ());
273
- }
274
-
275
261
} // namespace clangd
276
262
} // namespace clang
277
263
Original file line number Diff line number Diff line change 14
14
#include " llvm/ADT/Twine.h"
15
15
#include < cassert>
16
16
#include < condition_variable>
17
+ #include < future>
17
18
#include < memory>
18
19
#include < mutex>
19
20
#include < thread>
@@ -117,6 +118,19 @@ class AsyncTaskRunner {
117
118
std::size_t InFlightTasks = 0 ;
118
119
};
119
120
121
+ // / Runs \p Action asynchronously with a new std::thread. The context will be
122
+ // / propagated.
123
+ template <typename T>
124
+ std::future<T> runAsync (llvm::unique_function<T()> Action) {
125
+ return std::async (
126
+ std::launch::async,
127
+ [](llvm::unique_function<T ()> &&Action, Context Ctx) {
128
+ WithContext WithCtx (std::move (Ctx));
129
+ return Action ();
130
+ },
131
+ std::move (Action), Context::current ().clone ());
132
+ }
133
+
120
134
} // namespace clangd
121
135
} // namespace clang
122
136
#endif
You can’t perform that action at this time.
0 commit comments