summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_umtx.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_umtx.h')
-rw-r--r--lib/libthr/thread/thr_umtx.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_umtx.h b/lib/libthr/thread/thr_umtx.h
index 3f53faf..0a8034b 100644
--- a/lib/libthr/thread/thr_umtx.h
+++ b/lib/libthr/thread/thr_umtx.h
@@ -36,6 +36,7 @@
#define DEFAULT_URWLOCK {0,0,0,0,{0,0,0,0}}
int __thr_umutex_lock(struct umutex *mtx, uint32_t id) __hidden;
+int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __hidden;
int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
const struct timespec *timeout) __hidden;
int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) __hidden;
@@ -50,6 +51,8 @@ int _thr_umtx_wait(volatile long *mtx, long exp,
const struct timespec *timeout) __hidden;
int _thr_umtx_wait_uint(volatile u_int *mtx, u_int exp,
const struct timespec *timeout, int shared) __hidden;
+int _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int exp, int clockid,
+ const struct timespec *timeout, int shared) __hidden;
int _thr_umtx_wake(volatile void *mtx, int count, int shared) __hidden;
int _thr_ucond_wait(struct ucond *cv, struct umutex *m,
const struct timespec *timeout, int check_unpaking) __hidden;
@@ -97,6 +100,14 @@ _thr_umutex_lock(struct umutex *mtx, uint32_t id)
}
static inline int
+_thr_umutex_lock_spin(struct umutex *mtx, uint32_t id)
+{
+ if (_thr_umutex_trylock2(mtx, id) == 0)
+ return (0);
+ return (__thr_umutex_lock_spin(mtx, id));
+}
+
+static inline int
_thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
const struct timespec *timeout)
{
OpenPOWER on IntegriCloud