summaryrefslogtreecommitdiff
path: root/src/ipc.c
diff options
context:
space:
mode:
authorguo <[email protected]>2022-03-17 14:48:14 +0800
committerGitHub <[email protected]>2022-03-17 14:48:14 +0800
commit4562ae12460c22617185dd66332c5b591f256e7b (patch)
treef7b5a0f255fa1e28fdf4f283b3df0378a697a6af /src/ipc.c
parentaa80ba25d40f086c64497cd2453f1cd7879fb709 (diff)
[kernel] Revert modifications to the semaphore (#5682)
Diffstat (limited to 'src/ipc.c')
-rwxr-xr-xsrc/ipc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ipc.c b/src/ipc.c
index f634c32dd3..b25ba8cf74 100755
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -485,9 +485,6 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time)
RT_ASSERT(sem != RT_NULL);
RT_ASSERT(rt_object_get_type(&sem->parent.parent) == RT_Object_Class_Semaphore);
- /* current context checking */
- RT_DEBUG_SCHEDULER_AVAILABLE(time != 0);
-
RT_OBJECT_HOOK_CALL(rt_object_trytake_hook, (&(sem->parent.parent)));
/* disable interrupt */
@@ -517,6 +514,9 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time)
}
else
{
+ /* current context checking */
+ RT_DEBUG_SCHEDULER_AVAILABLE(RT_TRUE);
+
/* semaphore is unavailable, push to suspend list */
/* get current thread */
thread = rt_thread_self();