Skip to content

Commit

Permalink
server : fix missing lock (#9334)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson authored Sep 6, 2024
1 parent 8ebe8dd commit 4a1411b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 4a1411b

Please sign in to comment.