summaryrefslogtreecommitdiff
path: root/kern/rtmutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/rtmutex.h')
-rw-r--r--kern/rtmutex.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/kern/rtmutex.h b/kern/rtmutex.h
index ec79afa9..87cd15ad 100644
--- a/kern/rtmutex.h
+++ b/kern/rtmutex.h
@@ -87,6 +87,20 @@ rtmutex_lock(struct rtmutex *rtmutex)
}
}
+static inline int
+rtmutex_timedlock(struct rtmutex *rtmutex, uint64_t ticks)
+{
+ uintptr_t prev_owner;
+
+ prev_owner = rtmutex_lock_fast(rtmutex);
+
+ if (unlikely(prev_owner != 0)) {
+ return rtmutex_timedlock_slow(rtmutex, ticks);
+ }
+
+ return 0;
+}
+
/*
* Unlock a real-time mutex.
*