Select a new predicate branch when the selected branch in the predicate tree fails...
[c11tester.git] / waitobj.cc
index 692f0203fb2e1577c4b49efeefc78a64b4aefabc..39b47afc42e6a2fbc4889e2649406f19669a2b34 100644 (file)
@@ -2,6 +2,8 @@
 #include "threads-model.h"
 #include "funcnode.h"
 
+#define COUNTER_THRESHOLD 1000
+
 WaitObj::WaitObj(thread_id_t tid) :
        tid(tid),
        waiting_for(32),
@@ -142,8 +144,10 @@ bool WaitObj::incr_counter(thread_id_t tid)
        }
 
        thrd_action_counters[thread_id]++;
-       if (thrd_action_counters[thread_id] > 1000)
+       if (thrd_action_counters[thread_id] > COUNTER_THRESHOLD) {
+               thrd_action_counters[thread_id] = 0;
                return true;
+       }
 
        return false;
 }