From 7739652ad3c96b07062f9b1656d28f457ad8c985 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 22 Sep 2023 00:46:51 +0100 Subject: [PATCH] [*] Minor include header improvements --- .../Protocol/ProtocolStackFromDescription.hpp | 25 +++++++++++++++++++ Include/Aurora/Threading/InitOnce.hpp | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Include/Aurora/IO/Protocol/ProtocolStackFromDescription.hpp b/Include/Aurora/IO/Protocol/ProtocolStackFromDescription.hpp index 0965e269..e0a93173 100644 --- a/Include/Aurora/IO/Protocol/ProtocolStackFromDescription.hpp +++ b/Include/Aurora/IO/Protocol/ProtocolStackFromDescription.hpp @@ -43,6 +43,31 @@ namespace Aurora::IO::Protocol struct ProtocolStackDescription { + inline ProtocolStackDescription(AuUInt uBufferedStreamLength = 128 * 1024) : + type(EProtocolStackCreateType::eByBuffered), + byBuffered({ uBufferedStreamLength }) + { + + } + + inline ProtocolStackDescription(const AuSPtr &pWork, + bool bAutoTick = true, + bool bKillPipeOnFirstRootLevelFalse = true) : + type(EProtocolStackCreateType::eByPipe), + byPipe({ pWork, bAutoTick, bKillPipeOnFirstRootLevelFalse }) + { + + } + + inline ProtocolStackDescription(AuSPtr pStreamReader, + AuUInt uPreferredFragmentSize = 0, + AuUInt uBufferedStreamLength = 128 * 1024) : + type(EProtocolStackCreateType::eByBufferedAdhocStream), + byBufferedStream({ uBufferedStreamLength, pStreamReader, uPreferredFragmentSize }) + { + + } + EProtocolStackCreateType type; ProtocolStackByPipe byPipe; ProtocolStackByBuffered byBuffered; diff --git a/Include/Aurora/Threading/InitOnce.hpp b/Include/Aurora/Threading/InitOnce.hpp index 8f62cc00..37517393 100644 --- a/Include/Aurora/Threading/InitOnce.hpp +++ b/Include/Aurora/Threading/InitOnce.hpp @@ -317,8 +317,8 @@ namespace __audetail void InitOnceABI::_FinishFailed() { - AuAtomicUnset(&this->uToken_, 0); AuAtomicSet(&this->uToken_, 2); + AuAtomicUnset(&this->uToken_, 0); InitOnceABI::_Wakeup(); }