[PATCH v3] sys/lock.h: Add clock selection APIs for the
Mazen Adel Elmessady <[email protected]> Tue, 3 Mar 2026 23:58:50 +0200
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
Updated _Semaphore_Wait_timed (which is currently unused in RTEMS)
to _Semaphore_Wait_timed_clock which
to be used in RTEMS sempahore API.
This will ease the support of the new clock
functions added in Posix Issue 8.
V2: Kept _Semaphore_Wait_timed while adding
_Semaphore_Wait_timed_clock
V3: Added _Mutex_Acquire_timed_clock()
_Mutex_recursive_Acquire_timed_clock()
_Condition_Wait_timed_clock()
_Condition_Wait_recursive_timed_clock()
To include all the clock selection APIs for
all of the synchronization object class
---
newlib/libc/sys/rtems/include/sys/lock.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/newlib/libc/sys/rtems/include/sys/lock.h b/newlib/libc/sys/rtems/include/sys/lock.h
index d6169025b..79fb6b2de 100644
--- a/newlib/libc/sys/rtems/include/sys/lock.h
+++ b/newlib/libc/sys/rtems/include/sys/lock.h
@@ -27,6 +27,7 @@
#define _SYS_LOCK_H_
#include <sys/cdefs.h>
+#include <sys/_timespec.h>
#include <stddef.h>
__BEGIN_DECLS
@@ -137,6 +138,9 @@ void _Mutex_Acquire(struct _Mutex_Control *);
int _Mutex_Acquire_timed(struct _Mutex_Control *, const struct timespec *);
+int _Mutex_Acquire_timed_clock(struct _Mutex_Control *,
+ const struct timespec *, __clockid_t)
+
int _Mutex_Acquire_timed_ticks(struct _Mutex_Control *, __uint32_t);
int _Mutex_Try_acquire(struct _Mutex_Control *);
@@ -187,6 +191,9 @@ void _Mutex_recursive_Acquire(struct _Mutex_recursive_Control *);
int _Mutex_recursive_Acquire_timed(struct _Mutex_recursive_Control *,
const struct timespec *);
+int _Mutex_recursive_Acquire_timed_clock(struct _Mutex_recursive_Control *,
+ const struct timespec *, __clockid_t);
+
int _Mutex_recursive_Acquire_timed_ticks(struct _Mutex_recursive_Control *,
__uint32_t);
@@ -237,6 +244,9 @@ void _Condition_Wait(struct _Condition_Control *, struct _Mutex_Control *);
int _Condition_Wait_timed(struct _Condition_Control *,
struct _Mutex_Control *, const struct timespec *);
+int _Condition_Wait_timed_clock(struct _Condition_Control *,
+ struct _Mutex_Control *, const struct timespec *, __clockid_t);
+
int _Condition_Wait_timed_ticks(struct _Condition_Control *,
struct _Mutex_Control *, __uint32_t);
@@ -246,6 +256,9 @@ void _Condition_Wait_recursive(struct _Condition_Control *,
int _Condition_Wait_recursive_timed(struct _Condition_Control *,
struct _Mutex_recursive_Control *, const struct timespec *);
+int _Condition_Wait_recursive_timed_clock(struct _Condition_Control *,
+ struct _Mutex_recursive_Control *, const struct timespec *, __clockid_t);
+
int _Condition_Wait_recursive_timed_ticks(struct _Condition_Control *,
struct _Mutex_recursive_Control *, __uint32_t);
@@ -298,6 +311,9 @@ void _Semaphore_Wait(struct _Semaphore_Control *);
int _Semaphore_Wait_timed(struct _Semaphore_Control *,
const struct timespec *);
+int _Semaphore_Wait_timed_clock(struct _Semaphore_Control *,
+ const struct timespec *, __clockid_t);
+
int _Semaphore_Wait_timed_ticks(struct _Semaphore_Control *, __uint32_t);
int _Semaphore_Try_wait(struct _Semaphore_Control *);
--
2.51.0