diff options
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index b905b486a..92e877c3e 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -55,7 +55,7 @@ void SetupMainThread(Core::System& system, Process& owner_process, u32 priority, | |||
| 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 | KScopedSchedulerLock lock{kernel}; | 57 | KScopedSchedulerLock lock{kernel}; |
| 58 | thread->SetStatus(ThreadStatus::Ready); | 58 | thread->SetState(ThreadStatus::Ready); |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | } // Anonymous namespace | 61 | } // Anonymous namespace |
| @@ -406,21 +406,18 @@ void Process::LoadModule(CodeSet code_set, VAddr base_addr) { | |||
| 406 | ReprotectSegment(code_set.DataSegment(), Memory::MemoryPermission::ReadAndWrite); | 406 | ReprotectSegment(code_set.DataSegment(), Memory::MemoryPermission::ReadAndWrite); |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | bool Process::IsSignaled() const { | ||
| 410 | ASSERT(kernel.GlobalSchedulerContext().IsLocked()); | ||
| 411 | return is_signaled; | ||
| 412 | } | ||
| 413 | |||
| 409 | Process::Process(Core::System& system) | 414 | Process::Process(Core::System& system) |
| 410 | : SynchronizationObject{system.Kernel()}, page_table{std::make_unique<Memory::PageTable>( | 415 | : KSynchronizationObject{system.Kernel()}, page_table{std::make_unique<Memory::PageTable>( |
| 411 | system)}, | 416 | system)}, |
| 412 | handle_table{system.Kernel()}, address_arbiter{system}, mutex{system}, system{system} {} | 417 | handle_table{system.Kernel()}, address_arbiter{system}, mutex{system}, system{system} {} |
| 413 | 418 | ||
| 414 | Process::~Process() = default; | 419 | Process::~Process() = default; |
| 415 | 420 | ||
| 416 | void Process::Acquire(Thread* thread) { | ||
| 417 | ASSERT_MSG(!ShouldWait(thread), "Object unavailable!"); | ||
| 418 | } | ||
| 419 | |||
| 420 | bool Process::ShouldWait(const Thread* thread) const { | ||
| 421 | return !is_signaled; | ||
| 422 | } | ||
| 423 | |||
| 424 | void Process::ChangeStatus(ProcessStatus new_status) { | 421 | void Process::ChangeStatus(ProcessStatus new_status) { |
| 425 | if (status == new_status) { | 422 | if (status == new_status) { |
| 426 | return; | 423 | return; |
| @@ -428,7 +425,7 @@ void Process::ChangeStatus(ProcessStatus new_status) { | |||
| 428 | 425 | ||
| 429 | status = new_status; | 426 | status = new_status; |
| 430 | is_signaled = true; | 427 | is_signaled = true; |
| 431 | Signal(); | 428 | NotifyAvailable(); |
| 432 | } | 429 | } |
| 433 | 430 | ||
| 434 | ResultCode Process::AllocateMainThreadStack(std::size_t stack_size) { | 431 | ResultCode Process::AllocateMainThreadStack(std::size_t stack_size) { |