]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: posix timers: Add support for CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARM
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 22 Jan 2019 14:45:58 +0000 (15:45 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 22 Jan 2019 14:45:58 +0000 (15:45 +0100)
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/posix_timer.cc

index d4f2575f1ce08fb82ed6819e60934d5923638f98..8651c226cb8e39158d0a299f9a647303ad27c466 100644 (file)
@@ -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
This page took 0.032481 seconds and 5 git commands to generate.