+/*
+SnapVector<thread_id_t> WaitObj::incr_waiting_for_counter()
+{
+ SnapVector<thread_id_t> expire_thrds;
+
+ thrd_id_set_iter * iter = waiting_for.iterator();
+ while (iter->hasNext()) {
+ thread_id_t waiting_for_id = iter->next();
+ bool expire = incr_counter(waiting_for_id);
+
+ if (expire) {
+ expire_thrds.push_back(waiting_for_id);
+ }
+ }
+
+ return expire_thrds;
+}*/
+
+/**
+ * Increment action counter for thread tid
+ * @return true if the counter for tid expires
+ */
+bool WaitObj::incr_counter(thread_id_t tid)
+{
+ int thread_id = id_to_int(tid);
+
+ /* thrd_action_counters.resize does not work here */
+ while (thrd_action_counters.size() <= (uint) thread_id) {
+ thrd_action_counters.push_back(0);
+ }
+
+ thrd_action_counters[thread_id]++;
+
+ if (thrd_action_counters[thread_id] > 1000)
+ return true;
+
+ return false;
+}
+