From c3815c1e43589b46f19fa1c5c819ee7932f25bdb Mon Sep 17 00:00:00 2001 From: albator82 <73588094+albator82@users.noreply.github.com> Date: Tue, 26 May 2026 16:20:58 +0200 Subject: [PATCH] Update 9x10-single_io_context_several_handlers_thread.cpp --- .../9x10-single_io_context_several_handlers_thread.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Chapter_09/9x10-single_io_context_several_handlers_thread.cpp b/Chapter_09/9x10-single_io_context_several_handlers_thread.cpp index e02aec0..cee9d75 100644 --- a/Chapter_09/9x10-single_io_context_several_handlers_thread.cpp +++ b/Chapter_09/9x10-single_io_context_several_handlers_thread.cpp @@ -23,10 +23,9 @@ int main() { std::jthread io_context_thread([&io_context]() { io_context.run(); }); - const int num_threads = 4; - std::vector threads; + const int num_threads = 4; for (int i = 0; i < num_threads; ++i) { - background_task(i); + background_task(i);//io_context_thread will pick up the posted tasks } std::this_thread::sleep_for(5s);