This allows modules to do work on non-TUScheduler background threads.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/ClangdServer.cpp | ||
---|---|---|
190 | why is our contract saying that just calling stop is not enough? | |
clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp | ||
273 | = false; | |
361 | not sure what this is testing in addition to final callback receiving 3 as a value. |
trim tests
clang-tools-extra/clangd/ClangdServer.cpp | ||
---|---|---|
190 | We need Module::blockUntilIdle anyway for tests and stuff. And in practice requesting shutdown of background work doesn't naturally block until that work is complete IME. So we could ask every module to call blockUntilIdle() in stop(), or make stop() non-virtual and have it wrap requestStop()+blockUntilIdle(). Neither really seems simpler/cleaner to me overall, and it means modules shut down in serial instead of parallel. |
thanks, lgtm!
clang-tools-extra/clangd/ClangdServer.cpp | ||
---|---|---|
190 |
i was trying to ensure it is *only* used for tests, but i suppose you are right, in practice making stop block until in-flight tasks finishes vs stop+blockuntilidle is likely to have same effect, with the latter having the benefit of triggering shut down in parallel. so SGTM. |
Fix racy test - forgot to blockUntilIdle in sync!
Found a bug in blockUntilIdle, i'll send it separately.
why is our contract saying that just calling stop is not enough?
i think clangdserver should just signal shutdown to modules, and our contract should say that server facilities will be undefined from this point forward.
that way modules accessing the facilities, could block stop until they are done, and never make use of it afterwards? it'll make modules a little more complicated, at the very least they would need some stricter control whenever they are accessing facilities, but I think it is worth for keeping clangdserver shutdown cleaner. wdyt?