+ act = first;
+ }
+ }
+ if (act == NULL)
+ return act;
+
+
+ /* Find the model action with the earliest sequence number in case of a cycle.
+ */
+
+ for (int i = 0; i <= maxthreads; i++) {
+ action_list_t *threadlist = &threadlists[i];
+ if (threadlist->empty())
+ continue;
+ ModelAction *first = threadlist->front();
+ ClockVector *cv = cvmap.get(act);
+ ClockVector *cvfirst = cvmap.get(first);
+ if (first->get_seq_number()<act->get_seq_number()&&
+ (cv->synchronized_since(first)||!cvfirst->synchronized_since(act))) {