diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-18 12:39:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-18 12:39:52 -0400 |
commit | 0e7e98e24e87b84fb438601b5e6d75c5673c4ce5 (patch) | |
tree | 28b7237c38f72d232659cb1b26c1c57fe4dda6eb /src | |
parent | 889454f9bff3cb9b2034bba7f5961f77235eac82 (diff) | |
parent | 0eb3fa05e5af341ad2922b96de07f4cf32cba85a (diff) |
Merge pull request #9966 from bunnei/bounded-polyfill
common: bounded_threadsafe_queue: Use polyfill_thread.
Diffstat (limited to 'src')
-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 21217801e6..14e887c705 100644 --- a/src/common/bounded_threadsafe_queue.h +++ b/src/common/bounded_threadsafe_queue.h @@ -9,10 +9,11 @@ #include <memory> #include <mutex> #include <new> -#include <stop_token> #include <type_traits> #include <utility> +#include "common/polyfill_thread.h" + namespace Common { #if defined(__cpp_lib_hardware_interference_size) @@ -78,7 +79,7 @@ public: auto& slot = slots[idx(tail)]; if (!slot.turn.test()) { std::unique_lock lock{cv_mutex}; - cv.wait(lock, stop, [&slot] { return slot.turn.test(); }); + Common::CondvarWait(cv, lock, stop, [&slot] { return slot.turn.test(); }); } v = slot.move(); slot.destroy(); |