+ } else if (curr->get_type() == THREAD_JOIN) {
+ Thread *wait, *join;
+ wait = get_thread(curr->get_tid());
+ join = (Thread *)curr->get_location();
+ if (!join->is_complete())
+ scheduler->wait(wait, join);
+ } else if (curr->get_type() == THREAD_FINISH) {
+ Thread *th = get_thread(curr->get_tid());
+ while (!th->wait_list_empty()) {
+ Thread *wake = th->pop_wait_list();
+ scheduler->wake(wake);
+ }
+ th->complete();