group/pintos/src/threads/thread.c
/* Transitions a blocked thread T to the ready-to-run state.
   This is an error if T is not blocked.  (Use thread_yield() to
   make the running thread ready.)

   This function does not preempt the running thread.  This can
   be important: if the caller had disabled interrupts itself,
   it may expect that it can atomically unblock a thread and
   update other data. */
Transitions a blocked thread T to the ready-to-run state.
This is an error if T is not blocked.  (Use thread_yield() to
make the running thread ready.)

This function does not preempt the running thread.  This can
be important: if the caller had disabled interrupts itself,
it may expect that it can atomically unblock a thread and
update other data.
Transitions a blocked thread T to the ready - to - run state . This is an error if T is not blocked . ( Use thread_yield () to make the running thread ready . ) This function does not preempt the running thread . This can be important : if the caller had disabled interrupts itself it may expect that it can atomically unblock a thread and update other data .
void
thread_unblock (struct thread *t)
{
  enum intr_level old_level;
  ASSERT (is_thread (t));
  old_level = intr_disable ();
  ASSERT (t->status == THREAD_BLOCKED);
  if (thread_mlfqs)
    list_push_back(&mlfqs_lists[t->priority], &t->mlfqs_elem);
  list_insert_ordered(&ready_list, &t->elem, thread_priority_cmp, NULL);
  t->status = THREAD_READY;
  intr_set_level (old_level);
}
void thread_unblock ( struct thread * t ) { enum intr_level old_level ; ASSERT ( is_thread ( t ) ) ; old_level = intr_disable ( ) ; ASSERT ( t -> status == THREAD_BLOCKED ) ; if ( thread_mlfqs ) list_push_back ( & mlfqs_lists [ t -> priority ] , & t -> mlfqs_elem ) ; list_insert_ordered ( & ready_list , & t -> elem , thread_priority_cmp , NULL ) ; t -> status = THREAD_READY ; intr_set_level ( old_level ) ; }
Transitions a blocked thread T to the ready-to-run state.
Transitions a blocked thread T to the ready - to - run state .
// list_push_back (&ready_list, &t->elem);