diff options
Diffstat (limited to 'kern/mutex/mutex_adaptive_i.h')
-rw-r--r-- | kern/mutex/mutex_adaptive_i.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kern/mutex/mutex_adaptive_i.h b/kern/mutex/mutex_adaptive_i.h index b9952ec6..be822c24 100644 --- a/kern/mutex/mutex_adaptive_i.h +++ b/kern/mutex/mutex_adaptive_i.h @@ -78,6 +78,7 @@ mutex_adaptive_unlock_fast(struct mutex *mutex) } void mutex_adaptive_lock_slow(struct mutex *mutex); +int mutex_adaptive_timedlock_slow(struct mutex *mutex, uint64_t ticks); void mutex_adaptive_unlock_slow(struct mutex *mutex); /* @@ -105,6 +106,20 @@ mutex_impl_lock(struct mutex *mutex) } } +static inline int +mutex_impl_timedlock(struct mutex *mutex, uint64_t ticks) +{ + int error; + + error = mutex_adaptive_lock_fast(mutex); + + if (unlikely(error)) { + error = mutex_adaptive_timedlock_slow(mutex, ticks); + } + + return error; +} + static inline void mutex_impl_unlock(struct mutex *mutex) { |