mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-23 20:27:52 -05:00
nvflinger: Use jthread and stop_token for VSync thread
Avoids a destruction data race that may occur on the vsync thread
This commit is contained in:
@ -4,13 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
@ -109,9 +106,7 @@ private:
|
||||
/// Creates a layer with the specified layer ID in the desired display.
|
||||
void CreateLayerAtId(VI::Display& display, u64 layer_id);
|
||||
|
||||
static void VSyncThread(NVFlinger& nv_flinger);
|
||||
|
||||
void SplitVSync();
|
||||
void SplitVSync(std::stop_token stop_token);
|
||||
|
||||
std::shared_ptr<Nvidia::Module> nvdrv;
|
||||
|
||||
@ -133,9 +128,7 @@ private:
|
||||
|
||||
Core::System& system;
|
||||
|
||||
std::unique_ptr<std::thread> vsync_thread;
|
||||
std::unique_ptr<Common::Event> wait_event;
|
||||
std::atomic<bool> is_running{};
|
||||
std::jthread vsync_thread;
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
};
|
||||
|
Reference in New Issue
Block a user