+
+ for (unsigned int i = 1; i < get_num_threads(); i++) {
+ Thread *th = get_thread(int_to_id(i));
+ ModelAction *act = th->get_pending();
+ if (act && execution->is_enabled(th) && (th->get_state() != THREAD_BLOCKED) ){
+ if (act->is_write()){
+ std::memory_order order = act->get_mo();
+ if (order == std::memory_order_relaxed || order == std::memory_order_release) {
+ t = th;
+ break;
+ }
+ } else if (act->get_type() == THREAD_CREATE || act->get_type() == THREAD_START || act->get_type() == THREAD_FINISH) {
+ t = th;
+ break;
+ }
+ }
+ }
+
+