Kernel: replace usage of Core::System::GetInstance().PrepareReschedule() with callback
This commit is contained in:
parent
eb050b8403
commit
20f47583f6
9 changed files with 25 additions and 13 deletions
|
@ -24,7 +24,7 @@ void ReleaseThreadMutexes(Thread* thread) {
|
|||
thread->held_mutexes.clear();
|
||||
}
|
||||
|
||||
Mutex::Mutex(KernelSystem& kernel) : WaitObject(kernel) {}
|
||||
Mutex::Mutex(KernelSystem& kernel) : WaitObject(kernel), kernel(kernel) {}
|
||||
Mutex::~Mutex() {}
|
||||
|
||||
SharedPtr<Mutex> KernelSystem::CreateMutex(bool initial_locked, std::string name) {
|
||||
|
@ -54,7 +54,7 @@ void Mutex::Acquire(Thread* thread) {
|
|||
thread->held_mutexes.insert(this);
|
||||
holding_thread = thread;
|
||||
thread->UpdatePriority();
|
||||
Core::System::GetInstance().PrepareReschedule();
|
||||
kernel.PrepareReschedule();
|
||||
}
|
||||
|
||||
lock_count++;
|
||||
|
@ -87,7 +87,7 @@ ResultCode Mutex::Release(Thread* thread) {
|
|||
holding_thread->UpdatePriority();
|
||||
holding_thread = nullptr;
|
||||
WakeupAllWaitingThreads();
|
||||
Core::System::GetInstance().PrepareReschedule();
|
||||
kernel.PrepareReschedule();
|
||||
}
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue