summaryrefslogblamecommitdiffstats
path: root/src/core/hle/kernel/object.cpp
blob: bb1b687786256ed2a533fb5ee091b8e1308d1d01 (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                            
                                   



                                   
                                                                                             



                                 
                                   






                                   
                                   



                                    








                                   
// 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::Timer:
    case HandleType::ServerPort:
    case HandleType::ServerSession:
        return true;

    case HandleType::Unknown:
    case HandleType::WritableEvent:
    case HandleType::SharedMemory:
    case HandleType::Process:
    case HandleType::AddressArbiter:
    case HandleType::ResourceLimit:
    case HandleType::ClientPort:
    case HandleType::ClientSession:
        return false;
    }

    UNREACHABLE();
}

} // namespace Kernel