server : fix missing lock (#9334)

This commit is contained in:
Xuan Son Nguyen 2024-09-06 14:06:04 +02:00 committed by GitHub
parent 8ebe8ddebd
commit 4a1411b4f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,6 +412,7 @@ struct server_queue {
// multi-task version of post()
int post(std::vector<server_task> & tasks, bool front = false) {
std::unique_lock<std::mutex> lock(mutex_tasks);
for (auto & task : tasks) {
if (task.id == -1) {
task.id = id++;