summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-03-11 14:19:24 +0800
committerbernard <[email protected]>2014-03-11 14:19:24 +0800
commit898e0d2f3fa2e6bb77d3693d693e39cc73814dbb (patch)
tree1c63c6f8029deeb0bbeea6cee3f8fc97e6c9d31a /src/thread.c
parent6cab3b7dfa5b00df4d0e8bb51e6329ba3d3ea785 (diff)
[Kernel] stop thread timer when suspend a thread
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c
index c2282f6ee6..6c0490a6a3 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -575,6 +575,9 @@ rt_err_t rt_thread_suspend(rt_thread_t thread)
thread->stat = RT_THREAD_SUSPEND;
rt_schedule_remove_thread(thread);
+ /* stop thread timer anyway */
+ rt_timer_stop(&(thread->thread_timer));
+
/* enable interrupt */
rt_hw_interrupt_enable(temp);