[RTEMS Project] #4690: CLOCK_REALTIME thread queue no updated as part of clock_settime call
RTEMS trac
trac at rtems.org
Mon Aug 1 04:22:51 UTC 2022
#4690: CLOCK_REALTIME thread queue no updated as part of clock_settime call
--------------------------+--------------------
Reporter: Chris Johns | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone: 6.1
Component: score | Version: 6
Severity: normal | Keywords:
Blocked By: | Blocking:
--------------------------+--------------------
Setting the `CLOCK_REALTIME` clock using `clock_settime(CLOCK_REALTIME, ,
)` clock does not update thread relative period entries on the watchdog
timer queue.
A system's stability is effected if a user calls `clock_settime` on the
`CLOCK_REALTIME` clock. The watchdog's REALTIME clock queue is references
against the realtime clock and movement of the time means
The effected parts are:
1. User C code that calls `nanosleep`, `usleep`, `sleep` or
`clock_nanosleep(CLOCK_REALTIME, , )`.
2. User C++ code that uses `std::this_thread::sleep_for()` as GCC uses the
`nanosleep()` call.
3. LibBSD uses `CLOCK_REALTIME`.
The
[https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html
nanosleep] call is explained in more detail in the
[https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html
clock_nanosleep] rational. The `nanosleep` clock must be `CLOCK_REALTIME`.
The
[https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_settime.html
clock_settime] standard says:
Setting the value of the CLOCK_REALTIME clock via clock_settime() shall
have no effect on threads that are blocked waiting for a relative time
service based upon this clock, including the nanosleep() function; nor on
the expiration of relative timers based upon this clock. Consequently,
these time services shall expire when the requested relative interval
elapses, independently of the new or old value of the clock.
--
Ticket URL: <http://devel.rtems.org/ticket/4690>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list