summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2011-09-08 02:17:18 +0000
committerbernard.xiong <[email protected]>2011-09-08 02:17:18 +0000
commit9fce2db27e664fc3ea8961878ea7f3e8c5c929b2 (patch)
treea13f56b105004f02a5e8c960de0c83de05019af0 /src/thread.c
parent6c98ecd72918b5f28dadb00ae9bbe3ad799d654d (diff)
fixed the scheduling issue in rt_thread_startup; changed the end of line to UNIX style.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1703 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/thread.c b/src/thread.c
index cde506263d..f7f0bffafe 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -11,17 +11,18 @@
* Date Author Notes
* 2006-03-28 Bernard first version
* 2006-04-29 Bernard implement thread timer
- * 2006-04-30 Bernard add THREAD_DEBUG
- * 2006-05-27 Bernard fix the rt_thread_yield bug
- * 2006-06-03 Bernard fix the thread timer init bug
- * 2006-08-10 Bernard fix the timer bug in thread_sleep
- * 2006-09-03 Bernard change rt_timer_delete to rt_timer_detach
+ * 2006-04-30 Bernard added THREAD_DEBUG
+ * 2006-05-27 Bernard fixed the rt_thread_yield bug
+ * 2006-06-03 Bernard fixed the thread timer init bug
+ * 2006-08-10 Bernard fixed the timer bug in thread_sleep
+ * 2006-09-03 Bernard changed rt_timer_delete to rt_timer_detach
* 2006-09-03 Bernard implement rt_thread_detach
- * 2008-02-16 Bernard fix the rt_thread_timeout bug
+ * 2008-02-16 Bernard fixed the rt_thread_timeout bug
* 2010-03-21 Bernard change the errno of rt_thread_delay/sleep to RT_EOK.
* 2010-11-10 Bernard add cleanup callback function in thread exit.
* 2011-09-01 Bernard fixed rt_thread_exit issue when the current thread preempted,
* which reported by Jiaxing Lee.
+ * 2011-09-08 Bernard fixed the scheduling issue in rt_thread_startup.
*/
#include <rtthread.h>
@@ -213,8 +214,11 @@ rt_err_t rt_thread_startup (rt_thread_t thread)
thread->stat = RT_THREAD_SUSPEND;
/* then resume it */
rt_thread_resume(thread);
- /* do a scheduling */
- rt_schedule();
+ if (rt_thread_self() != RT_NULL)
+ {
+ /* do a scheduling */
+ rt_schedule();
+ }
return RT_EOK;
}