diff options
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(); |
