[PATCH] score: Use right clock for threadq timeouts

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jun 22 09:11:52 UTC 2022


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.
---
 cpukit/score/src/threadqtimeout.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/score/src/threadqtimeout.c b/cpukit/score/src/threadqtimeout.c
index 271ea27f27..10e194f6d8 100644
--- a/cpukit/score/src/threadqtimeout.c
+++ b/cpukit/score/src/threadqtimeout.c
@@ -132,7 +132,7 @@ void _Thread_queue_Add_timeout_monotonic_timespec(
 {
   struct timespec now;
 
-  _Timecounter_Getnanouptime( &now );
+  _Timecounter_Nanouptime( &now );
   _Thread_queue_Add_timeout_timespec(
     queue,
     the_thread,
@@ -152,7 +152,7 @@ void _Thread_queue_Add_timeout_realtime_timespec(
 {
   struct timespec now;
 
-  _Timecounter_Getnanotime( &now );
+  _Timecounter_Nanotime( &now );
   _Thread_queue_Add_timeout_timespec(
     queue,
     the_thread,
-- 
2.35.3



More information about the devel mailing list