summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
author孙冬梅 <[email protected]>2018-03-10 18:33:45 +0800
committerGitHub <[email protected]>2018-03-10 18:33:45 +0800
commit6e987b2350badd1777454b7324fc88d3275407d6 (patch)
tree1bbd5fc2cdaff0719d76122c91e0e736bf3f8116 /src/thread.c
parent351f15be4bdf575789be2e1d74934e830bd60554 (diff)
parent5534bab89ee767757a451b2efeb5341c1fb74872 (diff)
Merge pull request #2 from RT-Thread/master
update form origin
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c4
1 files changed, 2 insertions, 2 deletions
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 */