diff options
| author | guo <[email protected]> | 2022-03-17 14:48:14 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-17 14:48:14 +0800 |
| commit | 4562ae12460c22617185dd66332c5b591f256e7b (patch) | |
| tree | f7b5a0f255fa1e28fdf4f283b3df0378a697a6af /src/ipc.c | |
| parent | aa80ba25d40f086c64497cd2453f1cd7879fb709 (diff) | |
[kernel] Revert modifications to the semaphore (#5682)
Diffstat (limited to 'src/ipc.c')
| -rwxr-xr-x | src/ipc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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(); |
