diff options
| author | 2020-12-03 22:26:42 -0800 | |
|---|---|---|
| committer | 2020-12-06 00:03:24 -0800 | |
| commit | ccce6cb3be062fc7ae162bed32202538ebc2e3d9 (patch) | |
| tree | 206612bfc3718371d2355c8e3447aba288b1828f /src/core/hle/kernel/process.cpp | |
| parent | hle: kernel: Separate KScopedSchedulerLockAndSleep from k_scheduler. (diff) | |
| download | yuzu-ccce6cb3be062fc7ae162bed32202538ebc2e3d9.tar.gz yuzu-ccce6cb3be062fc7ae162bed32202538ebc2e3d9.tar.xz yuzu-ccce6cb3be062fc7ae162bed32202538ebc2e3d9.zip | |
hle: kernel: Migrate to KScopedSchedulerLock.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 238c03a13..b905b486a 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -54,7 +54,7 @@ void SetupMainThread(Core::System& system, Process& owner_process, u32 priority, | |||
| 54 | auto& kernel = system.Kernel(); | 54 | auto& kernel = system.Kernel(); |
| 55 | // Threads by default are dormant, wake up the main thread so it runs when the scheduler fires | 55 | // Threads by default are dormant, wake up the main thread so it runs when the scheduler fires |
| 56 | { | 56 | { |
| 57 | SchedulerLock lock{kernel}; | 57 | KScopedSchedulerLock lock{kernel}; |
| 58 | thread->SetStatus(ThreadStatus::Ready); | 58 | thread->SetStatus(ThreadStatus::Ready); |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| @@ -213,7 +213,7 @@ void Process::UnregisterThread(const Thread* thread) { | |||
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | ResultCode Process::ClearSignalState() { | 215 | ResultCode Process::ClearSignalState() { |
| 216 | SchedulerLock lock(system.Kernel()); | 216 | KScopedSchedulerLock lock(system.Kernel()); |
| 217 | if (status == ProcessStatus::Exited) { | 217 | if (status == ProcessStatus::Exited) { |
| 218 | LOG_ERROR(Kernel, "called on a terminated process instance."); | 218 | LOG_ERROR(Kernel, "called on a terminated process instance."); |
| 219 | return ERR_INVALID_STATE; | 219 | return ERR_INVALID_STATE; |
| @@ -347,7 +347,7 @@ static auto FindTLSPageWithAvailableSlots(std::vector<TLSPage>& tls_pages) { | |||
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | VAddr Process::CreateTLSRegion() { | 349 | VAddr Process::CreateTLSRegion() { |
| 350 | SchedulerLock lock(system.Kernel()); | 350 | KScopedSchedulerLock lock(system.Kernel()); |
| 351 | if (auto tls_page_iter{FindTLSPageWithAvailableSlots(tls_pages)}; | 351 | if (auto tls_page_iter{FindTLSPageWithAvailableSlots(tls_pages)}; |
| 352 | tls_page_iter != tls_pages.cend()) { | 352 | tls_page_iter != tls_pages.cend()) { |
| 353 | return *tls_page_iter->ReserveSlot(); | 353 | return *tls_page_iter->ReserveSlot(); |
| @@ -378,7 +378,7 @@ VAddr Process::CreateTLSRegion() { | |||
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | void Process::FreeTLSRegion(VAddr tls_address) { | 380 | void Process::FreeTLSRegion(VAddr tls_address) { |
| 381 | SchedulerLock lock(system.Kernel()); | 381 | KScopedSchedulerLock lock(system.Kernel()); |
| 382 | const VAddr aligned_address = Common::AlignDown(tls_address, Core::Memory::PAGE_SIZE); | 382 | const VAddr aligned_address = Common::AlignDown(tls_address, Core::Memory::PAGE_SIZE); |
| 383 | auto iter = | 383 | auto iter = |
| 384 | std::find_if(tls_pages.begin(), tls_pages.end(), [aligned_address](const auto& page) { | 384 | std::find_if(tls_pages.begin(), tls_pages.end(), [aligned_address](const auto& page) { |