diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2019-01-22 15:45:58 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-01-22 15:45:58 +0100 |
commit | 013e2bd9ecf85a8e7c94459aae17ad6d03bbcc31 (patch) | |
tree | 0d5aecbb2571b934a3d6529d9e602d72551ae4a5 | |
parent | 1daece586130467b632f7011395c514b6d8811f8 (diff) | |
download | cygnal-013e2bd9ecf85a8e7c94459aae17ad6d03bbcc31.tar.gz cygnal-013e2bd9ecf85a8e7c94459aae17ad6d03bbcc31.tar.bz2 cygnal-013e2bd9ecf85a8e7c94459aae17ad6d03bbcc31.zip |
Cygwin: posix timers: Add support for CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARM
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/posix_timer.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc index d4f2575f1..8651c226c 100644 --- a/winsup/cygwin/posix_timer.cc +++ b/winsup/cygwin/posix_timer.cc @@ -169,9 +169,8 @@ timer_tracker::thread_func () interval. Restart timer here with new due time. */ if (interval > INT_MAX * (NS100PERSEC / MSPERSEC)) { - /* TODO: CLOCK_REALTIME_ALARM / CLOCK_BOOTTIME_ALARM - See comment in arm_timer */ - BOOL Resume = FALSE; + BOOLEAN Resume = (clock_id == CLOCK_REALTIME_ALARM + || clock_id == CLOCK_BOOTTIME_ALARM); LARGE_INTEGER DueTime = { QuadPart: -interval }; NtSetTimer (timer, &DueTime, NULL, NULL, Resume, 0, NULL); @@ -386,10 +385,10 @@ timer_tracker::settime (int flags, const itimerspec *new_value, overrun_count_curr = 0; overrun_count = 0; overrun_event_running = OVR_EVENT_DISARMED; - /* TODO: CLOCK_REALTIME_ALARM / CLOCK_BOOTTIME_ALARM - Note: Advanced Power Settings -> Sleep -> Allow Wake Timers - since W10 1709 */ - Resume = FALSE; + /* Note: Advanced Power Settings -> Sleep -> Allow Wake Timers + since W10 1709 */ + Resume = (clock_id == CLOCK_REALTIME_ALARM + || clock_id == CLOCK_BOOTTIME_ALARM); if (interval > INT_MAX * (NS100PERSEC / MSPERSEC)) Period = 0; else |