- int ret = 0;
- Thread *th = model->get_thread(thrd_to_id(t));
- while (th->get_state() != THREAD_COMPLETED && !ret)
- /* seq_cst is just a 'don't care' parameter */
- ret = model->switch_to_master(new ModelAction(THREAD_JOIN, memory_order_seq_cst, NULL, VALUE_NONE));
- return ret;
+ Thread *th = t.priv;
+ model->switch_to_master(new ModelAction(THREAD_JOIN, std::memory_order_seq_cst, th, id_to_int(thrd_to_id(t))));
+ return 0;