summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-04-12 06:13:01 +0200
committerGitHub <noreply@github.com>2022-04-12 06:13:01 +0200
commitfd5e1e80dac515ecb4a1cf9a12665b6645349370 (patch)
tree5ce6c5bc77fe663428b9b66d1990c3bd64332581 /src/core/hle/kernel/kernel.cpp
parentMerge pull request #8196 from jbeich/freebsd (diff)
parentk_system_control: Fix data race (diff)
downloadyuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.tar
yuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.tar.gz
yuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.tar.bz2
yuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.tar.lz
yuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.tar.xz
yuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.tar.zst
yuzu-fd5e1e80dac515ecb4a1cf9a12665b6645349370.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/kernel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 134a0b8e9..481a0d7cb 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -85,7 +85,7 @@ struct KernelCore::Impl {
void InitializeCores() {
for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
- cores[core_id].Initialize(current_process->Is64BitProcess());
+ cores[core_id].Initialize((*current_process).Is64BitProcess());
system.Memory().SetCurrentPageTable(*current_process, core_id);
}
}
@@ -168,11 +168,11 @@ struct KernelCore::Impl {
// Shutdown all processes.
if (current_process) {
- current_process->Finalize();
+ (*current_process).Finalize();
// current_process->Close();
// TODO: The current process should be destroyed based on accurate ref counting after
// calling Close(). Adding a manual Destroy() call instead to avoid a memory leak.
- current_process->Destroy();
+ (*current_process).Destroy();
current_process = nullptr;
}
@@ -704,7 +704,7 @@ struct KernelCore::Impl {
// Lists all processes that exist in the current session.
std::vector<KProcess*> process_list;
- KProcess* current_process{};
+ std::atomic<KProcess*> current_process{};
std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context;
Kernel::TimeManager time_manager;