group/pintos/src/threads/thread.c
/* Deschedules the current thread and destroys it.  Never
   returns to the caller. */
Deschedules the current thread and destroys it.  Never
returns to the caller.
Deschedules the current thread and destroys it . Never returns to the caller .
void
thread_exit (void)
{
  ASSERT (!intr_context ());
#ifdef USERPROG
  process_exit ();
#endif
  intr_disable ();
  list_remove (&thread_current()->allelem);
  thread_current ()->status = THREAD_DYING;
  schedule ();
  NOT_REACHED ();
}
void thread_exit ( void ) { ASSERT ( ! intr_context ( ) ) ; #ifdef USERPROG process_exit ( ) ; #endif intr_disable ( ) ; list_remove ( & thread_current ( ) -> allelem ) ; thread_current ( ) -> status = THREAD_DYING ; schedule ( ) ; NOT_REACHED ( ) ; }
Deschedules the current thread and destroys it.
Deschedules the current thread and destroys it .
/* Remove thread from all threads list, set our status to dying,
     and schedule another process.  That process will destroy us
     when it calls thread_schedule_tail(). */