2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #9966 from bunnei/bounded-polyfill

common: bounded_threadsafe_queue: Use polyfill_thread.
This commit is contained in:
liamwhite 2023-03-18 12:39:52 -04:00 committed by GitHub
commit 0e7e98e24e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();