for (int j = 0; j <= maxthreads; j++) {
action_list_t *threadlist2 = &threadlists[j];
if (threadlist2->empty())
continue;
ModelAction *check = threadlist2->front();
for (int j = 0; j <= maxthreads; j++) {
action_list_t *threadlist2 = &threadlists[j];
if (threadlist2->empty())
continue;
ModelAction *check = threadlist2->front();