diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-19 13:47:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-24 10:19:05 +0200 |
commit | c31058947491ca319c901040219be39e4f8155b6 (patch) | |
tree | 435bf0887bd77e3d344b31275853a6e52fca8dd8 /cpukit/posix/src/mqueuetimedsend.c | |
parent | score: Rename function threadq support function (diff) | |
download | rtems-c31058947491ca319c901040219be39e4f8155b6.tar.bz2 |
score: Move thread queue timeout handling
Update #3117.
Update #3182.
Diffstat (limited to 'cpukit/posix/src/mqueuetimedsend.c')
-rw-r--r-- | cpukit/posix/src/mqueuetimedsend.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/cpukit/posix/src/mqueuetimedsend.c b/cpukit/posix/src/mqueuetimedsend.c index 3920a3fcc1..5596517c78 100644 --- a/cpukit/posix/src/mqueuetimedsend.c +++ b/cpukit/posix/src/mqueuetimedsend.c @@ -18,17 +18,6 @@ #include "config.h" #endif -#include <stdarg.h> - -#include <pthread.h> -#include <limits.h> -#include <errno.h> -#include <fcntl.h> -#include <mqueue.h> - -#include <rtems/system.h> -#include <rtems/score/todimpl.h> -#include <rtems/seterr.h> #include <rtems/posix/mqueueimpl.h> int mq_timedsend( @@ -39,33 +28,12 @@ int mq_timedsend( const struct timespec *abstime ) { - Watchdog_Interval ticks; - bool do_wait = true; - TOD_Absolute_timeout_conversion_results status; - - /* - * POSIX requires that blocking calls with timeouts that take - * an absolute timeout must ignore issues with the absolute - * time provided if the operation would otherwise succeed. - * So we check the abstime provided, and hold on to whether it - * is valid or not. If it isn't correct and in the future, - * then we do a polling operation and convert the UNSATISFIED - * status into the appropriate error. - * - * If the status is TOD_ABSOLUTE_TIMEOUT_INVALID, - * TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW, - * then we should not wait. - */ - status = _TOD_Absolute_timeout_to_ticks( abstime, CLOCK_REALTIME, &ticks ); - if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) - do_wait = false; - return _POSIX_Message_queue_Send_support( mqdes, msg_ptr, msg_len, msg_prio, - do_wait, - ticks + abstime, + _Thread_queue_Add_timeout_realtime_timespec ); } |