2018-08-02 04:40:00 +02: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 18:30:33 +02:00
|
|
|
#include "core/hle/kernel/kernel.h"
|
2018-08-02 04:40:00 +02:00
|
|
|
#include "core/hle/kernel/object.h"
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2018-08-28 18:30:33 +02:00
|
|
|
Object::Object(KernelCore& kernel) : kernel{kernel}, object_id{kernel.CreateNewObjectID()} {}
|
2018-08-02 04:40:00 +02:00
|
|
|
Object::~Object() = default;
|
|
|
|
|
|
|
|
bool Object::IsWaitable() const {
|
|
|
|
switch (GetHandleType()) {
|
2018-12-04 04:50:16 +01:00
|
|
|
case HandleType::ReadableEvent:
|
2018-08-02 04:40:00 +02:00
|
|
|
case HandleType::Thread:
|
2018-12-05 01:08:56 +01:00
|
|
|
case HandleType::Process:
|
2018-08-02 04:40:00 +02:00
|
|
|
case HandleType::ServerPort:
|
|
|
|
case HandleType::ServerSession:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case HandleType::Unknown:
|
2018-12-04 04:50:16 +01:00
|
|
|
case HandleType::WritableEvent:
|
2018-08-02 04:40:00 +02:00
|
|
|
case HandleType::SharedMemory:
|
2019-03-13 08:09:27 +01:00
|
|
|
case HandleType::TransferMemory:
|
2018-08-02 04:40:00 +02:00
|
|
|
case HandleType::AddressArbiter:
|
|
|
|
case HandleType::ResourceLimit:
|
|
|
|
case HandleType::ClientPort:
|
|
|
|
case HandleType::ClientSession:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
UNREACHABLE();
|
2018-12-19 02:52:32 +01:00
|
|
|
return false;
|
2018-08-02 04:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Kernel
|