Fixed bug 3069854.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_2.0.x@2191 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2010-09-25 05:55:32 +00:00
parent 46e4a207af
commit d6cc0c5ccd
2 changed files with 16 additions and 11 deletions

View File

@ -73,14 +73,15 @@
*/ */
Thread *init_thread(Thread *tp, tprio_t prio) { Thread *init_thread(Thread *tp, tprio_t prio) {
tp->p_flags = THD_MEM_MODE_STATIC;
tp->p_prio = prio; tp->p_prio = prio;
tp->p_state = THD_STATE_SUSPENDED; tp->p_state = THD_STATE_SUSPENDED;
#if CH_USE_REGISTRY tp->p_flags = THD_MEM_MODE_STATIC;
REG_INSERT(tp); #if CH_USE_MUTEXES
tp->p_realprio = prio;
tp->p_mtxlist = NULL;
#endif #endif
#if CH_USE_DYNAMIC #if CH_USE_EVENTS
tp->p_refs = 1; tp->p_epending = 0;
#endif #endif
#if CH_USE_NESTED_LOCKS #if CH_USE_NESTED_LOCKS
tp->p_locks = 0; tp->p_locks = 0;
@ -88,9 +89,8 @@ Thread *init_thread(Thread *tp, tprio_t prio) {
#if CH_DBG_THREADS_PROFILING #if CH_DBG_THREADS_PROFILING
tp->p_time = 0; tp->p_time = 0;
#endif #endif
#if CH_USE_MUTEXES #if CH_USE_DYNAMIC
tp->p_realprio = prio; tp->p_refs = 1;
tp->p_mtxlist = NULL;
#endif #endif
#if CH_USE_WAITEXIT #if CH_USE_WAITEXIT
list_init(&tp->p_waiting); list_init(&tp->p_waiting);
@ -98,10 +98,14 @@ Thread *init_thread(Thread *tp, tprio_t prio) {
#if CH_USE_MESSAGES #if CH_USE_MESSAGES
queue_init(&tp->p_msgqueue); queue_init(&tp->p_msgqueue);
#endif #endif
#if CH_USE_EVENTS #if CH_USE_REGISTRY
tp->p_epending = 0; chSysLock();
REG_INSERT(tp);
chSysUnlock();
#endif
#if defined(THREAD_EXT_EXIT_HOOK)
THREAD_EXT_INIT_HOOK(tp);
#endif #endif
THREAD_EXT_INIT(tp);
return tp; return tp;
} }

View File

@ -59,6 +59,7 @@
***************************************************************************** *****************************************************************************
*** 2.0.5 *** *** 2.0.5 ***
- FIX: Fixed race condition in threads creation (bug 3069854).
- FIX: Fixed broken CH_DBG_ENABLE_STACK_CHECK option in legacy CM3 port (bug - FIX: Fixed broken CH_DBG_ENABLE_STACK_CHECK option in legacy CM3 port (bug
3064274). 3064274).
- FIX: Fixed CAN_USE_SLEEP_MODE setting (bug 3064204). - FIX: Fixed CAN_USE_SLEEP_MODE setting (bug 3064204).