mirror of
https://github.com/citra-mirror/citra.git
synced 2024-08-20 10:23:23 +02:00
common: Replace lock_guard with scoped_lock
This commit is contained in:
parent
637ade3b25
commit
fe027a96fb
@ -54,7 +54,7 @@ public:
|
|||||||
// line before cv.wait
|
// line before cv.wait
|
||||||
// TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported.
|
// TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported.
|
||||||
// See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details.
|
// See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details.
|
||||||
std::lock_guard lock{cv_mutex};
|
std::scoped_lock lock{cv_mutex};
|
||||||
cv.notify_one();
|
cv.notify_one();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ public:
|
|||||||
|
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
void Push(Arg&& t) {
|
void Push(Arg&& t) {
|
||||||
std::lock_guard lock{write_lock};
|
std::scoped_lock lock{write_lock};
|
||||||
spsc_queue.Push(t);
|
spsc_queue.Push(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user