mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 01:56:43 +00:00

While attempting to disconnect the DAP transport reader thread is setting `disconnecting` as soon as it sees a [disconnect request](https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Disconnect). However, if it is processing another request when this disconnect arrives the `DAP::Loop` handler may exit the loop without replying to the disconnect request. There has been some instability on the CI jobs due to this race, for example https://lab.llvm.org/buildbot/#/builders/59/builds/16076 To address this, ensure we only return from `DAP::Loop` once we've emptied the queue.