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()) {
|
2018-12-04 06:50:16 +03:00
|
|
|
case HandleType::ReadableEvent:
|
2018-08-02 05:40:00 +03:00
|
|
|
case HandleType::Thread:
|
2018-12-05 03:08:56 +03:00
|
|
|
case HandleType::Process:
|
2018-08-02 05:40:00 +03:00
|
|
|
case HandleType::ServerPort:
|
|
|
|
case HandleType::ServerSession:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case HandleType::Unknown:
|
2018-12-04 06:50:16 +03:00
|
|
|
case HandleType::WritableEvent:
|
2018-08-02 05:40:00 +03:00
|
|
|
case HandleType::SharedMemory:
|
2019-03-13 10:09:27 +03:00
|
|
|
case HandleType::TransferMemory:
|
2018-08-02 05:40:00 +03:00
|
|
|
case HandleType::ResourceLimit:
|
|
|
|
case HandleType::ClientPort:
|
|
|
|
case HandleType::ClientSession:
|
2019-11-26 02:28:48 +03:00
|
|
|
case HandleType::Session:
|
2018-08-02 05:40:00 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
UNREACHABLE();
|
2018-12-19 04:52:32 +03:00
|
|
|
return false;
|
2018-08-02 05:40:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Kernel
|