diff options
| author | Shell <[email protected]> | 2023-10-14 13:07:45 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-14 13:07:45 +0800 |
| commit | 4158c8e88ec531cefd669579bf98f279a221b2c8 (patch) | |
| tree | 4ecc64bd3215d54c42b6ae275e4a38f67c40513b /include | |
| parent | 5d16042765ac989cab9bb4e9b112f1a98e17f4d5 (diff) | |
[smart] Replace irq disable/enable codes in futex (#7941)
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtthread.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/rtthread.h b/include/rtthread.h index 8c21e02312..610115134c 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -384,6 +384,16 @@ rt_err_t rt_mutex_take_interruptible(rt_mutex_t mutex, rt_int32_t time); rt_err_t rt_mutex_take_killable(rt_mutex_t mutex, rt_int32_t time); rt_err_t rt_mutex_release(rt_mutex_t mutex); rt_err_t rt_mutex_control(rt_mutex_t mutex, int cmd, void *arg); + +rt_inline rt_thread_t rt_mutex_get_owner(rt_mutex_t mutex) +{ + return mutex->owner; +} +rt_inline rt_ubase_t rt_mutex_get_hold(rt_mutex_t mutex) +{ + return mutex->hold; +} + #endif /* RT_USING_MUTEX */ #ifdef RT_USING_EVENT |
