fix mutex_trylock bug
[c11tester.git] / waitobj.h
index 9b4aead..36d9579 100644 (file)
--- a/waitobj.h
+++ b/waitobj.h
@@ -17,7 +17,8 @@ public:
 
        void add_waiting_for(thread_id_t other, FuncNode * node, int dist);
        void add_waited_by(thread_id_t other);
-       bool remove_waiting_for(thread_id_t other, FuncNode * node);
+       bool remove_waiting_for_node(thread_id_t other, FuncNode * node);
+       void remove_waiting_for(thread_id_t other);
        void remove_waited_by(thread_id_t other);
 
        thrd_id_set_t * getWaitingFor() { return &waiting_for; }
@@ -25,10 +26,12 @@ public:
 
        node_set_t * getTargetNodes(thread_id_t tid);
        int lookup_dist(thread_id_t tid, FuncNode * target);
-       int lookup_dist(thread_id_t other_tid);
-       void reset();
 
-       void print_waiting_for();
+       bool incr_counter(thread_id_t tid);
+
+       void clear_waiting_for();
+
+       void print_waiting_for(bool verbose = false);
        void print_waited_by();
 
        SNAPSHOTALLOC
@@ -44,6 +47,10 @@ private:
        SnapVector<dist_map_t *> thrd_dist_maps;
        SnapVector<node_set_t *> thrd_target_nodes;
 
+       /* Count the number of actions for threads that
+        * this thread is waiting for */
+       SnapVector<uint32_t> thrd_action_counters;
+
        dist_map_t * getDistMap(thread_id_t tid);
 };