From 4a1411b4f17b6569dc0a067e5914dcc0f738b370 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Fri, 6 Sep 2024 14:06:04 +0200 Subject: [PATCH] server : fix missing lock (#9334) --- examples/server/server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 109dbc023..5f2238d61 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -412,6 +412,7 @@ struct server_queue { // multi-task version of post() int post(std::vector & tasks, bool front = false) { + std::unique_lock lock(mutex_tasks); for (auto & task : tasks) { if (task.id == -1) { task.id = id++;