freemyipod r345 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r344‎ | r345 | r346 >
Date:23:57, 19 December 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Only suspend threads that are actually used when a stack overflow happens
Modified paths:
  • /embios/trunk/thread.c (modified) (history)

Diff [purge]

Index: embios/trunk/thread.c
@@ -253,8 +253,9 @@
254254 if ((int)current_thread->stack != -1 && *current_thread->stack != 0xaffebeaf)
255255 {
256256 for (i = 0; i < MAX_THREADS; i++)
257 - if (scheduler_threads[i].type == USER_THREAD)
258 - scheduler_threads[i].state = THREAD_SUSPENDED;
 257+ if (scheduler_threads[i].state != THREAD_FREE)
 258+ if (scheduler_threads[i].type == USER_THREAD)
 259+ scheduler_threads[i].state = THREAD_SUSPENDED;
259260 current_thread->state = THREAD_DEFUNCT;
260261 current_thread->block_type = THREAD_DEFUNCT_STKOV;
261262 wakeup_signal(&dbgwakeup);