File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
124124 break ;
125125
126126 default :
127+ RT_ASSERT (0 );
127128 break ;
128129 }
129130
Original file line number Diff line number Diff line change @@ -358,6 +358,8 @@ RTM_EXPORT(rt_thread_startup);
358358 */
359359rt_err_t rt_thread_detach (rt_thread_t thread )
360360{
361+ rt_base_t lock ;
362+
361363 /* thread check */
362364 RT_ASSERT (thread != RT_NULL );
363365 RT_ASSERT (rt_object_get_type ((rt_object_t )thread ) == RT_Object_Class_Thread );
@@ -377,12 +379,18 @@ rt_err_t rt_thread_detach(rt_thread_t thread)
377379 /* release thread timer */
378380 rt_timer_detach (& (thread -> thread_timer ));
379381
382+ /* disable interrupt */
383+ lock = rt_hw_interrupt_disable ();
384+
380385 /* change stat */
381386 thread -> stat = RT_THREAD_CLOSE ;
382387
383388 /* detach thread object */
384389 rt_object_detach ((rt_object_t )thread );
385390
391+ /* enable interrupt */
392+ rt_hw_interrupt_enable (lock );
393+
386394 return RT_EOK ;
387395}
388396RTM_EXPORT (rt_thread_detach );
You can’t perform that action at this time.
0 commit comments