[clangd] Fix flaky throttler test

The production code doesn't depend on the relative destruction order of
the throttle request and the main request, but the test does.
This commit is contained in:
Sam McCall 2022-07-07 18:09:15 +02:00
parent 61d417ceff
commit eb64dbd6e0
1 changed files with 2 additions and 0 deletions

View File

@ -498,6 +498,8 @@ public:
// Build the preamble and let the waiters know about it.
build(std::move(*CurrentReq));
}
// Releasing the throttle before destroying the request assists testing.
Throttle.reset();
bool IsEmpty = false;
{
std::lock_guard<std::mutex> Lock(Mutex);