AuroraRuntime/Include/Aurora/IO/IOSleep.hpp

45 lines
1.2 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IOSleep.hpp
Date: 2022-5-13
Author: Reece
***/
#pragma once
namespace Aurora::IO
{
/**
* Waits for at least one overlapped IO event
*
* @param timeout Timeout in milliseconds, zero = indefinite
* @return true on preemption, false on timeout
*/
AUKN_SYM bool WaitFor(AuUInt32 uMilliseconds, bool bWaitEntireFrame = true);
/**
* Sleeps for the given timeout in milliseconds
* Equivalent to WaitFor(timeout, true)
*
* @param timeout Timeout in milliseconds, zero = indefinite
* @return True if an IO event occurred
*/
AUKN_SYM bool IOSleep(AuUInt32 uMilliseconds);
/**
* Sleeps up to the given timeout in milliseconds
* Equivalent to WaitFor(timeout, false)
*
* @param timeout Timeout in milliseconds, zero = indefinite
* @return True if an IO event occurred
*/
AUKN_SYM bool IOYieldFor(AuUInt32 uMilliseconds);
/**
* Nonblocking yield for IO alerts
*
* @param timeout Timeout in milliseconds, zero = indefinite
* @return True if an IO event occurred
*/
AUKN_SYM bool IOYield();
}