2022-05-13 18:54:26 +00:00
|
|
|
/***
|
|
|
|
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
|
2022-08-05 10:28:34 +00:00
|
|
|
*
|
2022-05-13 18:54:26 +00:00
|
|
|
* @param timeout Timeout in milliseconds, zero = indefinite
|
|
|
|
* @return true on preemption, false on timeout
|
|
|
|
*/
|
2022-08-29 15:46:46 +00:00
|
|
|
AUKN_SYM bool WaitFor(AuUInt32 uMilliseconds, bool bWaitEntireFrame = true);
|
2022-06-11 23:01:27 +00:00
|
|
|
|
2022-08-05 10:28:34 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2022-08-29 15:46:46 +00:00
|
|
|
AUKN_SYM bool IOSleep(AuUInt32 uMilliseconds);
|
2022-08-05 10:28:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2022-08-29 15:46:46 +00:00
|
|
|
AUKN_SYM bool IOYieldFor(AuUInt32 uMilliseconds);
|
2022-08-05 10:28:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Nonblocking yield for IO alerts
|
|
|
|
*
|
|
|
|
* @param timeout Timeout in milliseconds, zero = indefinite
|
|
|
|
* @return True if an IO event occurred
|
|
|
|
*/
|
2022-06-11 23:01:27 +00:00
|
|
|
AUKN_SYM bool IOYield();
|
2022-05-13 18:54:26 +00:00
|
|
|
}
|