intel/cpp-baremetal-senders-and-receivers

`requeue_policy::deferred` is not thread safe

mjcaisse opened this issue · 1 comments

std::exchange is not atomic and a higher priority enqueue_task could be called mid-exchange, resulting in a torn data structure.

https://github.com/intel/cpp-baremetal-senders-and-receivers/blob/main/include/async/schedulers/task_manager.hpp#L30

Well spotted! The race is present with either enqueueing a task or cancelling a task.