diff options
| author | guo <[email protected]> | 2023-06-21 22:42:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-21 22:42:50 +0800 |
| commit | 8d2072de5569840591d039478046b3c9ae6947aa (patch) | |
| tree | 0f893993ecbfd3ceb760da8a14f1be3849254edc /src/ipc.c | |
| parent | 74b15524db12c1d923eedf893f1729b19ec75af7 (diff) | |
[kernel]add api rt_hw_interrupt_is_disabled (#7706)
Diffstat (limited to 'src/ipc.c')
| -rw-r--r-- | src/ipc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -507,6 +507,9 @@ static rt_err_t _rt_sem_take(rt_sem_t sem, rt_int32_t timeout, int suspend_flag) RT_OBJECT_HOOK_CALL(rt_object_trytake_hook, (&(sem->parent.parent))); + /* current context checking */ + RT_DEBUG_SCHEDULER_AVAILABLE(sem->value == 0 && timeout != 0); + /* disable interrupt */ level = rt_hw_interrupt_disable(); @@ -534,9 +537,6 @@ static rt_err_t _rt_sem_take(rt_sem_t sem, rt_int32_t timeout, int suspend_flag) } else { - /* current context checking */ - RT_DEBUG_SCHEDULER_AVAILABLE(RT_TRUE); - /* semaphore is unavailable, push to suspend list */ /* get current thread */ thread = rt_thread_self(); |
