diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-18 12:50:41 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-18 18:47:43 +0200 |
commit | a89ecaa1a94d49ddae7753d6b83923e9d2a00486 (patch) | |
tree | 2fccf3fd6b5a82f0415b497db190fbfa582a3866 /cpukit/posix/src/sigtimedwait.c | |
parent | posix: Fix use of clock for relative times (diff) | |
download | rtems-a89ecaa1a94d49ddae7753d6b83923e9d2a00486.tar.bz2 |
score: Simplify thread queue timeout handling
Add Thread_queue_Context::timeout_absolute to specify an absolute or
relative timeout. This avoid having to get the current time twice for
timeouts relative to the current time. It moves also functionality to
common code.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/sigtimedwait.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cpukit/posix/src/sigtimedwait.c b/cpukit/posix/src/sigtimedwait.c index 4e2b6c2658..0bdb65fd45 100644 --- a/cpukit/posix/src/sigtimedwait.c +++ b/cpukit/posix/src/sigtimedwait.c @@ -76,7 +76,6 @@ int sigtimedwait( siginfo_t signal_information; siginfo_t *the_info; int signo; - struct timespec uptime; Thread_queue_Context queue_context; int error; @@ -93,13 +92,10 @@ int sigtimedwait( */ if ( timeout != NULL ) { - const struct timespec *end; - - _Timecounter_Nanouptime( &uptime ); - end = _Watchdog_Future_timespec( &uptime, timeout ); _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec( &queue_context, - end + timeout, + false ); } else { _Thread_queue_Context_set_enqueue_do_nothing_extra( &queue_context ); |