mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-12 03:07:46 +00:00
[common] use libc++ provided jthread instead of in-house one (which deadlocks on FBSD 14) (#351)
Needs test on our CI targets to see I didn't miss anything. Worried about android. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/351 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
9a098441de
commit
dfe10bc851
14 changed files with 49 additions and 364 deletions
|
@ -39,8 +39,8 @@ void CDmaPusher::ProcessEntries(std::stop_token stop_token) {
|
|||
while (!stop_token.stop_requested()) {
|
||||
{
|
||||
std::unique_lock l{command_mutex};
|
||||
Common::CondvarWait(command_cv, l, stop_token,
|
||||
[this]() { return command_lists.size() > 0; });
|
||||
command_cv.wait(l, stop_token,
|
||||
[this]() { return command_lists.size() > 0; });
|
||||
if (stop_token.stop_requested()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ u64 ThreadManager::PushCommand(CommandData&& command_data, bool block) {
|
|||
state.queue.EmplaceWait(std::move(command_data), fence, block);
|
||||
|
||||
if (block) {
|
||||
Common::CondvarWait(state.cv, lk, thread.get_stop_token(), [this, fence] {
|
||||
state.cv.wait(lk, thread.get_stop_token(), [this, fence] {
|
||||
return fence <= state.signaled_fence.load(std::memory_order_relaxed);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ void MasterSemaphore::WaitThread(std::stop_token token) {
|
|||
vk::Fence fence;
|
||||
{
|
||||
std::unique_lock lock{wait_mutex};
|
||||
Common::CondvarWait(wait_cv, lock, token, [this] { return !wait_queue.empty(); });
|
||||
wait_cv.wait(lock, token, [this] { return !wait_queue.empty(); });
|
||||
if (token.stop_requested()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ void PresentManager::PresentThread(std::stop_token token) {
|
|||
std::unique_lock lock{queue_mutex};
|
||||
|
||||
// Wait for presentation frames
|
||||
Common::CondvarWait(frame_cv, lock, token, [this] { return !present_queue.empty(); });
|
||||
frame_cv.wait(lock, token, [this] { return !present_queue.empty(); });
|
||||
if (token.stop_requested()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ void Scheduler::WorkerThread(std::stop_token stop_token) {
|
|||
std::unique_lock lk{queue_mutex};
|
||||
|
||||
// Wait for work.
|
||||
Common::CondvarWait(event_cv, lk, stop_token, [&] { return TryPopQueue(work); });
|
||||
event_cv.wait(lk, stop_token, [&] { return TryPopQueue(work); });
|
||||
|
||||
// If we've been asked to stop, we're done.
|
||||
if (stop_token.stop_requested()) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
@ -224,7 +227,7 @@ void TurboMode::Run(std::stop_token stop_token) {
|
|||
#endif
|
||||
// Wait for the next graphics queue submission if necessary.
|
||||
std::unique_lock lk{m_submission_lock};
|
||||
Common::CondvarWait(m_submission_cv, lk, stop_token, [this] {
|
||||
m_submission_cv.wait(lk, stop_token, [this] {
|
||||
return (std::chrono::steady_clock::now() - m_submission_time) <=
|
||||
std::chrono::milliseconds{100};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue