Reece
7fde7d04fb
[+] IIOBufferedStreamAvailable callback [+] IIOProcessor singleshot work items / IIOProcessorWorkUnit [+] IOPipeCallback description of a pipes destination [+] IOPipeInputData description of a pipes source [+] IOPipeRequest, IOPipeRequestAIO, IOPipeRequestBasic [+] IPipeBackend hooks for on start/end hooks of IOPipeRequestBasics [*] Update IOAdapaterAsyncStream implementation to better support caller buffering [*] Updated IAsyncStreamReader to include a warm/dequeue API for direct async usage [*] Fix NT IO regressions [*] Fix ThreadPool shutdown on an unregistered thread [*] Fix race condition in Async.NT.cpp & fix signalable state to closely match Linux (dunno how this was passing before) [*] Refactor IOProcessorWorkUnit -> IIOProcessorWorkUnit [*] Update experimental header to include the changes
94 lines
1.9 KiB
C++
94 lines
1.9 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: LSHandle.cpp
|
|
Date: 2021-10-1
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "LSHandle.hpp"
|
|
|
|
namespace Aurora::IO::Loop
|
|
{
|
|
LSHandle::LSHandle()
|
|
{}
|
|
|
|
LSHandle::LSHandle(AuUInt handle_) : handle(handle_)
|
|
{}
|
|
|
|
LSHandle::LSHandle(AuUInt handleRd, AuUInt handleWr) : handle(handleRd)
|
|
#if defined(AURORA_IS_POSIX_DERIVED)
|
|
, handleWr(handleWr)
|
|
#endif
|
|
{}
|
|
|
|
bool LSHandle::OnTrigger(AuUInt handle)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
const AuList<AuUInt> &LSHandle::GetHandles()
|
|
{
|
|
static AuList<AuUInt> kDummyArray;
|
|
return kDummyArray;
|
|
}
|
|
|
|
#if defined(AURORA_IS_POSIX_DERIVED)
|
|
|
|
const AuList<AuUInt> &LSHandle::GetWriteHandles()
|
|
{
|
|
static AuList<AuUInt> kDummyArray;
|
|
return kDummyArray;
|
|
}
|
|
|
|
AuUInt LSHandle::GetWriteHandle()
|
|
{
|
|
return this->handleWr;
|
|
}
|
|
|
|
void LSHandle::UpdateWriteHandle(AuUInt handle)
|
|
{
|
|
this->handleWr = handle;
|
|
}
|
|
|
|
#endif
|
|
|
|
void LSHandle::UpdateReadHandle(AuUInt handle)
|
|
{
|
|
this->handle = handle;
|
|
}
|
|
|
|
AuUInt LSHandle::GetHandle()
|
|
{
|
|
return this->handle;
|
|
}
|
|
|
|
bool LSHandle::Singular()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
ELoopSource LSHandle::GetType()
|
|
{
|
|
return ELoopSource::eSourceHandle;
|
|
}
|
|
|
|
bool LSHandle::HasValidHandle()
|
|
{
|
|
#if defined(AURORA_IS_POSIX_DERIVED)
|
|
return this->handle != kInvalidHandle || this->handleWr != kInvalidHandle;
|
|
#elif defined(AURORA_IS_MODERNNT_DERIVED)
|
|
return this->handle != kInvalidHandle;
|
|
#endif
|
|
}
|
|
|
|
AUKN_SYM AuSPtr<ILoopSource> NewLSOSHandle(AuUInt handle)
|
|
{
|
|
if (handle == kInvalidHandle)
|
|
{
|
|
return {};
|
|
}
|
|
|
|
return AuMakeShared<LSHandle>(handle);
|
|
}
|
|
} |