#2732 closed defect (fixed)

Add clock_nanosleep()

Reported by: Gedare Bloom Owned by: Gedare Bloom
Priority: normal Milestone: 5.1
Component: posix Version: 5
Severity: normal Keywords: posix
Cc: Blocked By:
Blocking:

Description

The clock_nanosleep function is provided to enable specifying the clock source (CLOCK_REALTIME or CLOCK_MONOTONIC) and to control whether or not to use an absolute or relative reference point via TIMER_ABSTIME flag.

See also: http://pubs.opengroup.org/onlinepubs/009695399/functions/clock_nanosleep.html

Change History (8)

comment:1 Changed on Jul 25, 2016 at 4:45:22 PM by Gedare Bloom <gedare@…>

In e0f17fcf6f06d3383cd389d809ee4e3d6e0fb14d/rtems:

posix: fix clock_nanosleep and nanosleep clock use

Sleeping with CLOCK_REALTIME should use the WATCHDOG_ABSOLUTE
clock discipline for the threadq so that the timeout interval
may change in case the clock source changes. Similarly,
CLOCK_MONOTONIC uses the WATCHDOG_RELATIVE threadq that will
only wakeup the thread after the requested count of ticks elapse.

updates #2732

comment:2 Changed on Jul 26, 2016 at 6:17:57 PM by Gedare Bloom <gedare@…>

In 39d97ab78cfcc37eb8b1e7d9f9717f51b249155b/rtems:

cpukit: refactor nanosleep and use 64-bit timeout for threadq

  • Fixes a bug with elapsed time calculations misusing absolute time arguments in nanosleep_helper by passing the requested relative interval.
  • Fixes a bug with truncation of absolute timeouts by passing the full 64-bit value to Thread_queue_Enqueue.
  • Share yield logic between nanosleep and clock_nanosleep.

updates #2732

comment:3 Changed on Jul 29, 2016 at 5:14:45 PM by Gedare Bloom <gedare@…>

In 842005e432136953d670e39cedc2d665ea949e7b/rtems:

posix: nanosleep: optimize away a time conversion

updates #2732

comment:4 Changed on Aug 10, 2016 at 4:10:21 PM by Gedare Bloom <gedare@…>

In 709594f0fb29d4f860b99cda264ea3e74c635a72/rtems:

posix: nanosleep: adjust elapsed time calculation

Use clock_gettime before and after sleep to calculate
the time spent asleep, and the amount of time remaining.

updates #2732

comment:5 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:6 Changed on Jun 30, 2017 at 1:27:37 PM by Gedare Bloom

Resolution: fixed
Status: newclosed

comment:7 Changed on Oct 16, 2017 at 6:17:09 AM by Sebastian Huber

Component: scoreposix

comment:8 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.