summaryrefslogtreecommitdiff
path: root/src/ipc.c
diff options
context:
space:
mode:
authorguo <[email protected]>2023-06-21 22:42:50 +0800
committerGitHub <[email protected]>2023-06-21 22:42:50 +0800
commit8d2072de5569840591d039478046b3c9ae6947aa (patch)
tree0f893993ecbfd3ceb760da8a14f1be3849254edc /src/ipc.c
parent74b15524db12c1d923eedf893f1729b19ec75af7 (diff)
[kernel]add api rt_hw_interrupt_is_disabled (#7706)
Diffstat (limited to 'src/ipc.c')
-rw-r--r--src/ipc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ipc.c b/src/ipc.c
index d6c3717b9e..3a5a0efa61 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -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();