summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-19 13:47:57 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-24 10:19:05 +0200
commitc31058947491ca319c901040219be39e4f8155b6 (patch)
tree435bf0887bd77e3d344b31275853a6e52fca8dd8 /cpukit/posix/include/rtems
parentscore: Rename function threadq support function (diff)
downloadrtems-c31058947491ca319c901040219be39e4f8155b6.tar.bz2
score: Move thread queue timeout handling
Update #3117. Update #3182.
Diffstat (limited to 'cpukit/posix/include/rtems')
-rw-r--r--cpukit/posix/include/rtems/posix/mqueueimpl.h25
-rw-r--r--cpukit/posix/include/rtems/posix/muteximpl.h32
2 files changed, 27 insertions, 30 deletions
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 <rtems/posix/mqueue.h>
#include <rtems/posix/posixapi.h>
#include <rtems/score/coremsgimpl.h>
+#include <rtems/score/threadqimpl.h>
#include <rtems/seterr.h>
@@ -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(