mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-05 23:07:53 +00:00
c7462ce712
Process instances can be waited upon for state changes. This is also utilized by svcResetSignal, which will be modified in an upcoming change. This simply puts all of the WaitObject related machinery in place.
37 lines
969 B
C++
37 lines
969 B
C++
// Copyright 2018 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#include "common/assert.h"
|
|
#include "core/hle/kernel/kernel.h"
|
|
#include "core/hle/kernel/object.h"
|
|
|
|
namespace Kernel {
|
|
|
|
Object::Object(KernelCore& kernel) : kernel{kernel}, object_id{kernel.CreateNewObjectID()} {}
|
|
Object::~Object() = default;
|
|
|
|
bool Object::IsWaitable() const {
|
|
switch (GetHandleType()) {
|
|
case HandleType::ReadableEvent:
|
|
case HandleType::Thread:
|
|
case HandleType::Process:
|
|
case HandleType::Timer:
|
|
case HandleType::ServerPort:
|
|
case HandleType::ServerSession:
|
|
return true;
|
|
|
|
case HandleType::Unknown:
|
|
case HandleType::WritableEvent:
|
|
case HandleType::SharedMemory:
|
|
case HandleType::AddressArbiter:
|
|
case HandleType::ResourceLimit:
|
|
case HandleType::ClientPort:
|
|
case HandleType::ClientSession:
|
|
return false;
|
|
}
|
|
|
|
UNREACHABLE();
|
|
}
|
|
|
|
} // namespace Kernel
|