summaryrefslogtreecommitdiffstats
path: root/testsuites/validation
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-06-22 11:02:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-06-23 09:20:11 +0200
commitcd50bea678baa494640415377f7be146246ba3e4 (patch)
tree4adcddf4c426b2630c0af8b5a26757523fcf05af /testsuites/validation
parentTFTPFS: Fix test configuration for FP targets (diff)
downloadrtems-cd50bea678baa494640415377f7be146246ba3e4.tar.bz2
score: Use right clock for threadq timeouts
Use CLOCK_REALTIME and CLOCK_MONOTONIC for relative thread queue timeouts instead of CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE. This fixes an issue with clock_nanosleep() in combination with clock_gettime(). Close #4669.
Diffstat (limited to 'testsuites/validation')
-rw-r--r--testsuites/validation/tc-clock-nanosleep.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/testsuites/validation/tc-clock-nanosleep.c b/testsuites/validation/tc-clock-nanosleep.c
index 2857d8e274..2f4d439efe 100644
--- a/testsuites/validation/tc-clock-nanosleep.c
+++ b/testsuites/validation/tc-clock-nanosleep.c
@@ -325,14 +325,20 @@ static void Worker( rtems_task_argument arg )
while ( true ) {
T_scheduler_log *log;
+ uint32_t counter;
SuspendSelf();
log = T_scheduler_record_4( &ctx->scheduler_log );
T_null( log );
- _Timecounter_Getnanotime( &ctx->now_realtime );
- _Timecounter_Getnanouptime( &ctx->now_monotonic );
+ counter = GetTimecountCounter();
+ _Timecounter_Nanotime( &ctx->now_realtime );
+ SetTimecountCounter( counter );
+
+ counter = GetTimecountCounter();
+ _Timecounter_Nanouptime( &ctx->now_monotonic );
+ SetTimecountCounter( counter );
ctx->status = clock_nanosleep(
ctx->clock_id,