在GD32F103RC的
开发板上,跑了官方文档中心的signal例程;启动后,在串口调试助手输入signal_sample后,正确执行信号接收回调函数后,返回接受信号的线程,线程调用rt_thread_mdelay时,调度器竟然不可用了,程序无法执行下去。不知道时什么原因导致调度器不可用?求助大家。
- | /
- - RT - Thread Operating System
- / | 5.2.1 build Jul 14 2025 17:19:15
- 2006 - 2024 Copyright by RT-Thread team
- msh >signal_sample
- thread1 count : 0
- thread1 count : 1
- thread1 count : 2
- msh >
- msh >thread1 received signal 10
- thread1 count : 3
- Function[_thread_sleep]: scheduler is not available
- (0) assertion failed at function:_thread_sleep, line number:631
后面进入到_thread_sleep函数,定位到下面代码
- #define RT_DEBUG_SCHEDULER_AVAILABLE(need_check)
- do
- {
- if (need_check)
- {
- if (rt_critical_level() != 0)
- {
- rt_kprintf("Function[%s]: scheduler is not availablen",
- __FUNCTION__);
- RT_ASSERT(0)
- }
- RT_DEBUG_IN_THREAD_CONTEXT;
- }
- }