smp: Use Thread_Control.is_executing

FIXME: This area needs proper locking.
This commit is contained in:
Sebastian Huber
2013-07-26 14:04:22 +02:00
parent 45ca51c4f7
commit ff63d2dbf9

View File

@@ -41,13 +41,10 @@
return true;
}
#else
int cpu;
for ( cpu=0 ; cpu < rtems_smp_get_processor_count() ; cpu++ ) {
Per_CPU_Control *p = &_Per_CPU_Information[cpu];
if ( p->executing->Object.id == the_thread->Object.id ) {
*time_of_context_switch = p->time_of_last_context_switch;
return true;
}
/* FIXME: Locking */
if ( the_thread->is_executing ) {
*time_of_context_switch = the_thread->cpu->time_of_last_context_switch;
return true;
}
#endif
return false;