`requeue_policy::deferred` is not thread safe
mjcaisse opened this issue · 1 comments
mjcaisse commented
std::exchange
is not atomic and a higher priority enqueue_task
could be called mid-exchange, resulting in a torn data structure.
bdeane-intel commented
Well spotted! The race is present with either enqueueing a task or cancelling a task.