소스 검색

[kernel] 为rt_thread_sleep添加上下文检查

Ylne 3 년 전
부모
커밋
069086ae28
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/thread.c

+ 3 - 0
src/thread.c

@@ -577,6 +577,9 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
     RT_ASSERT(thread != RT_NULL);
     RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread);
 
+    /* current context checking */
+    RT_DEBUG_SCHEDULER_AVAILABLE(RT_TRUE);
+
     /* disable interrupt */
     level = rt_hw_interrupt_disable();