+ int currtid=id_to_int(act->get_tid());
+ int prevtid=(prevfairness != NULL)?id_to_int(prevfairness->action->get_tid()):0;
+
+ if ( model->params.fairwindow != 0 ) {
+ for(int i=0;i<nthreads;i++) {
+ ASSERT(i<((int)fairness.size()));
+ struct fairness_info * fi=& fairness[i];
+ struct fairness_info * prevfi=(par!=NULL)&&(i<par->get_num_threads())?&par->fairness[i]:NULL;
+ if (prevfi) {
+ *fi=*prevfi;
+ }
+ if (parent->enabled_array[i]) {
+ fi->enabled_count++;
+ }
+ if (i==currtid) {
+ fi->turns++;
+ fi->priority = false;
+ }
+ //Do window processing
+ if (prevfairness != NULL) {
+ if (prevfairness -> parent->enabled_array[i])
+ fi->enabled_count--;
+ if (i==prevtid) {
+ fi->turns--;
+ }
+ //Need full window to start evaluating conditions
+ //If we meet the enabled count and have no turns, give us priority
+ if ((fi->enabled_count >= model->params.enabledcount) &&
+ (fi->turns == 0))
+ fi->priority = true;
+ }
+ }
+ }
+ }