case THREAD_JOIN:
type_str = "thread join";
break;
+ case THREAD_FINISH:
+ type_str = "thread finish";
+ break;
case ATOMIC_READ:
type_str = "atomic read";
break;
THREAD_START, /**< First action in each thread */
THREAD_YIELD, /**< A thread yield action */
THREAD_JOIN, /**< A thread join action */
+ THREAD_FINISH, /**< A thread completion action */
ATOMIC_READ, /**< An atomic read action */
ATOMIC_WRITE, /**< An atomic write action */
ATOMIC_RMWR, /**< The read part of an atomic RMW action */
/* Call the actual thread function */
curr_thread->start_routine(curr_thread->arg);
+
+ /* Finish thread properly */
+ model->switch_to_master(new ModelAction(THREAD_FINISH, std::memory_order_seq_cst, curr_thread));
}
/**