diff options
| author | 2021-01-24 22:54:37 -0800 | |
|---|---|---|
| committer | 2021-01-28 21:42:26 -0800 | |
| commit | 3856564727e3efcf85fb0c1e5431cab22d818370 (patch) | |
| tree | 589d4322c34c6ae15184b322b9302c33f1c34087 /src/core/hle/kernel/svc.cpp | |
| parent | hle: kernel: threading: Fix bug with host thread naming. (diff) | |
| download | yuzu-3856564727e3efcf85fb0c1e5431cab22d818370.tar.gz yuzu-3856564727e3efcf85fb0c1e5431cab22d818370.tar.xz yuzu-3856564727e3efcf85fb0c1e5431cab22d818370.zip | |
hle: kernel: process: Add state lock.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index dbef854f8..7fd514e9d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1450,11 +1450,14 @@ static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr e | |||
| 1450 | Svc::ResultInvalidPriority); | 1450 | Svc::ResultInvalidPriority); |
| 1451 | R_UNLESS(process.CheckThreadPriority(priority), Svc::ResultInvalidPriority); | 1451 | R_UNLESS(process.CheckThreadPriority(priority), Svc::ResultInvalidPriority); |
| 1452 | 1452 | ||
| 1453 | ASSERT(kernel.CurrentProcess()->GetResourceLimit()->Reserve(ResourceType::Threads, 1)); | 1453 | ASSERT(process.GetResourceLimit()->Reserve(ResourceType::Threads, 1)); |
| 1454 | 1454 | ||
| 1455 | CASCADE_RESULT(std::shared_ptr<KThread> thread, | 1455 | std::shared_ptr<KThread> thread; |
| 1456 | KThread::Create(system, ThreadType::User, "", entry_point, priority, arg, | 1456 | { |
| 1457 | core_id, stack_bottom, &process)); | 1457 | KScopedLightLock lk{process.GetStateLock()}; |
| 1458 | CASCADE_RESULT(thread, KThread::Create(system, ThreadType::User, "", entry_point, priority, | ||
| 1459 | arg, core_id, stack_bottom, &process)); | ||
| 1460 | } | ||
| 1458 | 1461 | ||
| 1459 | const auto new_thread_handle = process.GetHandleTable().Create(thread); | 1462 | const auto new_thread_handle = process.GetHandleTable().Create(thread); |
| 1460 | if (new_thread_handle.Failed()) { | 1463 | if (new_thread_handle.Failed()) { |