From 597e2bc6c015c30b16347ba165ca873ba30cd123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 1 Sep 2026 13:29:15 +0200 Subject: [PATCH] Add a comment about the shared_ptr --- Common/Net/HTTPServer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Common/Net/HTTPServer.h b/Common/Net/HTTPServer.h index 445126e321..b6d1be7fc9 100644 --- a/Common/Net/HTTPServer.h +++ b/Common/Net/HTTPServer.h @@ -22,6 +22,10 @@ private: struct Worker { std::thread thread; // Set by the worker as its last act, read by whoever calls Run() next. + // It does look a bit fragile with the atomic inside a shared_ptr, but the way + // this is used, it should be fine. The atomic is only used to signal that the thread + // is done, and the shared_ptr is only used to keep the atomic alive until + // the thread is joined. std::shared_ptr> done; }; std::vector workers_;