diff options
Diffstat (limited to 'src/common/bounded_threadsafe_queue.h')
| -rw-r--r-- | src/common/bounded_threadsafe_queue.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/bounded_threadsafe_queue.h b/src/common/bounded_threadsafe_queue.h index 21217801e..14e887c70 100644 --- a/src/common/bounded_threadsafe_queue.h +++ b/src/common/bounded_threadsafe_queue.h | |||
| @@ -9,10 +9,11 @@ | |||
| 9 | #include <memory> | 9 | #include <memory> |
| 10 | #include <mutex> | 10 | #include <mutex> |
| 11 | #include <new> | 11 | #include <new> |
| 12 | #include <stop_token> | ||
| 13 | #include <type_traits> | 12 | #include <type_traits> |
| 14 | #include <utility> | 13 | #include <utility> |
| 15 | 14 | ||
| 15 | #include "common/polyfill_thread.h" | ||
| 16 | |||
| 16 | namespace Common { | 17 | namespace Common { |
| 17 | 18 | ||
| 18 | #if defined(__cpp_lib_hardware_interference_size) | 19 | #if defined(__cpp_lib_hardware_interference_size) |
| @@ -78,7 +79,7 @@ public: | |||
| 78 | auto& slot = slots[idx(tail)]; | 79 | auto& slot = slots[idx(tail)]; |
| 79 | if (!slot.turn.test()) { | 80 | if (!slot.turn.test()) { |
| 80 | std::unique_lock lock{cv_mutex}; | 81 | std::unique_lock lock{cv_mutex}; |
| 81 | cv.wait(lock, stop, [&slot] { return slot.turn.test(); }); | 82 | Common::CondvarWait(cv, lock, stop, [&slot] { return slot.turn.test(); }); |
| 82 | } | 83 | } |
| 83 | v = slot.move(); | 84 | v = slot.move(); |
| 84 | slot.destroy(); | 85 | slot.destroy(); |