From 38b9ed3118f7df9fd683b9d3bd4425ab604ee2bc Mon Sep 17 00:00:00 2001 From: BernardXiong Date: Thu, 1 Mar 2018 13:36:22 +0800 Subject: [Kernel] add sigwait implementation --- src/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/thread.c') diff --git a/src/thread.c b/src/thread.c index 3a3e55302e..ea0ba0bfc9 100644 --- a/src/thread.c +++ b/src/thread.c @@ -638,7 +638,7 @@ rt_err_t rt_thread_suspend(rt_thread_t thread) if ((thread->stat & RT_THREAD_STAT_MASK) != RT_THREAD_READY) { - RT_DEBUG_LOG(RT_DEBUG_THREAD, ("thread suspend: thread disorder, %d\n", + RT_DEBUG_LOG(RT_DEBUG_THREAD, ("thread suspend: thread disorder, 0x%2x\n", thread->stat)); return -RT_ERROR; @@ -648,7 +648,7 @@ rt_err_t rt_thread_suspend(rt_thread_t thread) temp = rt_hw_interrupt_disable(); /* change thread stat */ - thread->stat = RT_THREAD_SUSPEND; + thread->stat = RT_THREAD_SUSPEND | (thread->stat & ~RT_THREAD_STAT_MASK); rt_schedule_remove_thread(thread); /* stop thread timer anyway */ -- cgit v1.3.1