From c31058947491ca319c901040219be39e4f8155b6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 19 Oct 2017 13:47:57 +0200 Subject: score: Move thread queue timeout handling Update #3117. Update #3182. --- cpukit/posix/include/rtems/posix/mqueueimpl.h | 25 +++++++++++---------- cpukit/posix/include/rtems/posix/muteximpl.h | 32 ++++++++++++--------------- 2 files changed, 27 insertions(+), 30 deletions(-) (limited to 'cpukit/posix/include/rtems') diff --git a/cpukit/posix/include/rtems/posix/mqueueimpl.h b/cpukit/posix/include/rtems/posix/mqueueimpl.h index 5888800ca1..6813a3ef88 100644 --- a/cpukit/posix/include/rtems/posix/mqueueimpl.h +++ b/cpukit/posix/include/rtems/posix/mqueueimpl.h @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -63,12 +64,12 @@ void _POSIX_Message_queue_Delete( * @note This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open time. */ ssize_t _POSIX_Message_queue_Receive_support( - mqd_t mqdes, - char *msg_ptr, - size_t msg_len, - unsigned int *msg_prio, - bool wait, - Watchdog_Interval timeout + mqd_t mqdes, + char *msg_ptr, + size_t msg_len, + unsigned int *msg_prio, + const struct timespec *abstime, + Thread_queue_Enqueue_callout enqueue_callout ); /** @@ -77,12 +78,12 @@ ssize_t _POSIX_Message_queue_Receive_support( * This routine posts a message to a specified message queue. */ int _POSIX_Message_queue_Send_support( - mqd_t mqdes, - const char *msg_ptr, - size_t msg_len, - unsigned int msg_prio, - bool wait, - Watchdog_Interval timeout + mqd_t mqdes, + const char *msg_ptr, + size_t msg_len, + unsigned int msg_prio, + const struct timespec *abstime, + Thread_queue_Enqueue_callout enqueue_callout ); RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control * diff --git a/cpukit/posix/include/rtems/posix/muteximpl.h b/cpukit/posix/include/rtems/posix/muteximpl.h index f146e0d9db..435b43634d 100644 --- a/cpukit/posix/include/rtems/posix/muteximpl.h +++ b/cpukit/posix/include/rtems/posix/muteximpl.h @@ -132,7 +132,7 @@ Status_Control _POSIX_Mutex_Seize_slow( POSIX_Mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, - bool wait, + const struct timespec *abstime, Thread_queue_Context *queue_context ); @@ -171,7 +171,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Seize( unsigned long flags, const Thread_queue_Operations *operations, Thread_Control *executing, - bool wait, + const struct timespec *abstime, Thread_queue_Context *queue_context ) { @@ -198,7 +198,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Seize( the_mutex, operations, executing, - wait, + abstime, queue_context ); } @@ -329,11 +329,11 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_set_owner( } RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_seize( - POSIX_Mutex_Control *the_mutex, - unsigned long flags, - Thread_Control *executing, - bool wait, - Thread_queue_Context *queue_context + POSIX_Mutex_Control *the_mutex, + unsigned long flags, + Thread_Control *executing, + const struct timespec *abstime, + Thread_queue_Context *queue_context ) { Thread_Control *owner; @@ -371,7 +371,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_seize( the_mutex, POSIX_MUTEX_PRIORITY_CEILING_TQ_OPERATIONS, executing, - wait, + abstime, queue_context ); } @@ -444,16 +444,12 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_surrender( return STATUS_SUCCESSFUL; } -/** - * @brief POSIX Mutex Lock Support Method - * - * A support routine which implements guts of the blocking, non-blocking, and - * timed wait version of mutex lock. - */ +#define POSIX_MUTEX_ABSTIME_TRY_LOCK ((uintptr_t) 1) + int _POSIX_Mutex_Lock_support( - pthread_mutex_t *mutex, - bool blocking, - Watchdog_Interval timeout + pthread_mutex_t *mutex, + const struct timespec *abstime, + Thread_queue_Enqueue_callout enqueue_callout ); static inline POSIX_Mutex_Control *_POSIX_Mutex_Get( -- cgit v1.2.3