2018-08-02 05:40:00 +03:00
|
|
|
// Copyright 2018 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "common/assert.h"
|
2018-08-28 19:30:33 +03:00
|
|
|
#include "core/hle/kernel/kernel.h"
|
2018-08-02 05:40:00 +03:00
|
|
|
#include "core/hle/kernel/object.h"
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2018-08-28 19:30:33 +03:00
|
|
|
Object::Object(KernelCore& kernel) : kernel{kernel}, object_id{kernel.CreateNewObjectID()} {}
|
2018-08-02 05:40:00 +03:00
|
|
|
Object::~Object() = default;
|
|
|
|
|
|
|
|
bool Object::IsWaitable() const {
|
|
|
|
switch (GetHandleType()) {
|
|
|
|
case HandleType::Event:
|
|
|
|
case HandleType::Thread:
|
|
|
|
case HandleType::Timer:
|
|
|
|
case HandleType::ServerPort:
|
|
|
|
case HandleType::ServerSession:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case HandleType::Unknown:
|
|
|
|
case HandleType::SharedMemory:
|
|
|
|
case HandleType::Process:
|
|
|
|
case HandleType::AddressArbiter:
|
|
|
|
case HandleType::ResourceLimit:
|
|
|
|
case HandleType::ClientPort:
|
|
|
|
case HandleType::ClientSession:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
UNREACHABLE();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Kernel
|