summaryrefslogtreecommitdiffstats
path: root/spec/c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-08-04 07:59:49 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-08-04 08:01:34 +0200
commit11121d0280b9f8ebb45d3793f14e10cd4062c4bf (patch)
treeaea57c3b0d299c7145b9e84f3a03696d8955460b /spec/c
parentutil: Ignore decode errors (diff)
downloadrtems-central-11121d0280b9f8ebb45d3793f14e10cd4062c4bf.tar.bz2
spec: Fix relative CLOCK_REALTIME sleep
A relative CLOCK_REALTIME time out shall not be affected by CLOCK_REALTIME changes through clock_settime(). Since our CLOCK_REALTIME is basically just CLOCK_MONOTONIC plus an offset, we can simply use the CLOCK_MONOTONIC watchdog for relative CLOCK_REALTIME time outs. Update #4690.
Diffstat (limited to 'spec/c')
-rw-r--r--spec/c/req/clock-nanosleep.yml14
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/c/req/clock-nanosleep.yml b/spec/c/req/clock-nanosleep.yml
index e2c62514..6aa11df6 100644
--- a/spec/c/req/clock-nanosleep.yml
+++ b/spec/c/req/clock-nanosleep.yml
@@ -69,12 +69,7 @@ post-conditions:
the ``rqtp`` parameter.
- name: Relative
test-code: |
- if ( ctx->clock_id == CLOCK_REALTIME ) {
- expire = ctx->now_realtime;
- } else {
- expire = ctx->now_monotonic;
- }
-
+ expire = ctx->now_monotonic;
expire.tv_sec += ctx->rqtp_obj.tv_sec;
expire.tv_nsec += ctx->rqtp_obj.tv_nsec;
@@ -87,8 +82,9 @@ post-conditions:
T_eq_long( ctx->timer_info.expire_timespec.tv_nsec, expire.tv_nsec );
text: |
The timer of the calling task shall expire at the time point specified by
- the sum of the current time of the clock specified by the ``clock_id``
- parameter and the interval specified by the ``rqtp`` parameter.
+ the sum of the current time of the clock specified by
+ ${../if/clock-monotonic:/name} and the interval specified by the ``rqtp``
+ parameter.
test-epilogue: null
test-prologue: |
struct timespec expire;
@@ -463,7 +459,7 @@ transition-map:
pre-conditions:
RQTpSec: PastOrNow
then: Inactive
- - specified-by: ClockId
+ - else: Monotonic
Expire:
- if:
pre-conditions: