static void _Thread_Wait_for_execution_stop( Thread_Control *the_thread )
{
#if defined(RTEMS_SMP)
  /*
   * It is very unlikely that we see an executing thread here.  It can happen
   * in case the thread termination sequence is interrupted by a slow interrupt
   * service on a remote processor.
   */
  while ( _Thread_Is_executing_on_a_processor( the_thread ) ) {
    /* Wait */
  }
#else
  (void) the_thread;
#endif
}
Esempio n. 2
0
 static bool is_executing_on_a_core(
   Thread_Control    *the_thread,
   Timestamp_Control *time_of_context_switch
 )
 {
   #ifndef RTEMS_SMP
     if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
       *time_of_context_switch = _Thread_Time_of_last_context_switch;
       return true;
     }
   #else
     /* FIXME: Locking */
     if ( _Thread_Is_executing_on_a_processor( the_thread ) ) {
       *time_of_context_switch =
         _Thread_Get_CPU( the_thread )->time_of_last_context_switch;
       return true;
     }
   #endif
   return false;
 }