mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-06-15 05:38:46 +02:00
7ad2e11705
This commit adds the Services API and implements some services. It also changes the name of the application to Skyline and replaces the icon.
22 lines
918 B
C++
22 lines
918 B
C++
#include "KSyncObject.h"
|
|
#include "../../os.h"
|
|
|
|
namespace skyline::kernel::type {
|
|
KSyncObject::KSyncObject(skyline::handle_t handle, pid_t pid, const skyline::DeviceState &state, skyline::kernel::type::KType type) : KObject(handle, pid, state, type) {}
|
|
|
|
void KSyncObject::Signal() {
|
|
for (auto&[tid, process] : state.os->threadMap) {
|
|
auto &thread = process->threadMap.at(tid);
|
|
if (thread->status == type::KThread::ThreadStatus::Waiting) {
|
|
for (auto &waitHandle : thread->waitHandles) {
|
|
if (handle == waitHandle) {
|
|
thread->status = type::KThread::ThreadStatus::Runnable;
|
|
state.nce->SetRegister(Wreg::W0, constant::status::Success, thread->pid);
|
|
state.nce->SetRegister(Wreg::W1, handle, thread->pid);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|