Skip to content

Commit

Permalink
core: add missing locks in command queue
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Nov 11, 2024
1 parent 6a93d83 commit e393094
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mavsdk/core/mavlink_command_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void MavlinkCommandSender::queue_command_async(

CommandIdentification identification = identification_from_command(command);

LockedQueue<Work>::Guard work_queue_guard(_work_queue);
for (const auto& work : _work_queue) {
if (work->identification == identification && callback == nullptr) {
if (_command_debugging) {
Expand Down Expand Up @@ -117,6 +118,7 @@ void MavlinkCommandSender::queue_command_async(

CommandIdentification identification = identification_from_command(command);

LockedQueue<Work>::Guard work_queue_guard(_work_queue);
for (const auto& work : _work_queue) {
if (work->identification == identification && callback == nullptr) {
if (_command_debugging) {
Expand Down

0 comments on commit e393094

Please sign in to comment.