[Lldb-commits] [lldb] [lldb-dap] Ensure the IO forwarding threads are managed by the DAP object lifecycle. (PR #120457)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 20 02:37:50 PST 2024
================
@@ -1099,6 +1098,14 @@ void request_disconnect(DAP &dap, const llvm::json::Object &request) {
dap.broadcaster.BroadcastEventByType(eBroadcastBitStopProgressThread);
dap.progress_event_thread.join();
}
+ if (dap.stdout_forward_thread.joinable()) {
+ dap.pout.Close();
----------------
labath wrote:
This may be moot due to due other issue, but you should only close the write end before joining the thread (the read end can be closed after joining, or from within the thread). Closing the read descriptor while the thread is running leads to a race with the `Read` call inside the thread.
https://github.com/llvm/llvm-project/pull/120457
More information about the lldb-commits
mailing list