mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-25 06:31:02 +00:00
Fix waiting (#675)
This PR fixes `INFINITE` waiting (`SleepEx`, `WaitForSingleObject`, etc). Currently `INFINITE` is not infinite but "at this moment" (waiting point in time == `clock.steady_now()`).
This commit is contained in:
@@ -3,8 +3,14 @@
|
||||
|
||||
namespace utils
|
||||
{
|
||||
std::chrono::steady_clock::time_point convert_delay_interval_to_time_point(clock& c, const LARGE_INTEGER delay_interval)
|
||||
std::chrono::steady_clock::time_point convert_delay_interval_to_time_point(clock& c, const LARGE_INTEGER delay_interval,
|
||||
const LARGE_INTEGER infinite_value)
|
||||
{
|
||||
if (delay_interval.QuadPart == infinite_value.QuadPart)
|
||||
{
|
||||
return std::chrono::steady_clock::time_point::min();
|
||||
}
|
||||
|
||||
if (delay_interval.QuadPart <= 0)
|
||||
{
|
||||
const auto relative_time = -delay_interval.QuadPart;
|
||||
|
||||
@@ -102,7 +102,9 @@ namespace utils
|
||||
}
|
||||
};
|
||||
|
||||
std::chrono::steady_clock::time_point convert_delay_interval_to_time_point(clock& c, LARGE_INTEGER delay_interval);
|
||||
std::chrono::steady_clock::time_point convert_delay_interval_to_time_point(clock& c, LARGE_INTEGER delay_interval,
|
||||
LARGE_INTEGER infinite_value = {.LowPart = 0,
|
||||
.HighPart = -2147483648});
|
||||
|
||||
KSYSTEM_TIME convert_to_ksystem_time(const std::chrono::system_clock::time_point& tp);
|
||||
void convert_to_ksystem_time(volatile KSYSTEM_TIME* dest, const std::chrono::system_clock::time_point& tp);
|
||||
|
||||
Reference in New Issue
Block a user