Kernel: Refactor synchronization to better match RE

This commit is contained in:
Fernando Sahmkow
2020-02-11 17:36:39 -04:00
committed by FernandoS27
parent c5aefe42aa
commit d23d504d77
23 changed files with 212 additions and 80 deletions

View File

@ -10,6 +10,7 @@
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/object.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/synchronization.h"
#include "core/hle/kernel/synchronization_object.h"
#include "core/hle/kernel/thread.h"
@ -18,6 +19,10 @@ namespace Kernel {
SynchronizationObject::SynchronizationObject(KernelCore& kernel) : Object{kernel} {}
SynchronizationObject::~SynchronizationObject() = default;
void SynchronizationObject::Signal() {
kernel.Synchronization().SignalObject(*this);
}
void SynchronizationObject::AddWaitingThread(std::shared_ptr<Thread> thread) {
auto itr = std::find(waiting_threads.begin(), waiting_threads.end(), thread);
if (itr == waiting_threads.end())