updated remove_thread(), should cover Linus' hints

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4570 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jörg Hohensohn 2004-05-01 15:36:12 +00:00
parent 1bad055d2a
commit 72e08fb838

View file

@ -194,6 +194,11 @@ void remove_thread(int threadnum)
thread_stack_size[i] = thread_stack_size[i+1]; thread_stack_size[i] = thread_stack_size[i+1];
thread_contexts[i] = thread_contexts[i+1]; thread_contexts[i] = thread_contexts[i+1];
} }
if (current_thread == threadnum) /* deleting the current one? */
current_thread = num_threads; /* set beyond last, avoid store harm */
else if (current_thread > threadnum) /* within the moved positions? */
current_thread--; /* adjust it, point to same context again */
} }
void init_threads(void) void init_threads(void)