5 #include "modeltypes.h"
7 typedef HashTable<FuncNode *, int, uintptr_t, 0> dist_map_t;
8 typedef HashSet<FuncNode *, uintptr_t, 0> node_set_t;
9 typedef HSIterator<FuncNode *, uintptr_t, 0> node_set_iter;
16 thread_id_t get_tid() { return tid; }
18 void add_waiting_for(thread_id_t other, FuncNode * node, int dist);
19 void add_waited_by(thread_id_t other);
20 bool remove_waiting_for_node(thread_id_t other, FuncNode * node);
21 void remove_waiting_for(thread_id_t other);
22 void remove_waited_by(thread_id_t other);
24 thrd_id_set_t * getWaitingFor() { return &waiting_for; }
25 thrd_id_set_t * getWaitedBy() { return &waited_by; }
27 node_set_t * getTargetNodes(thread_id_t tid);
28 int lookup_dist(thread_id_t tid, FuncNode * target);
30 bool incr_counter(thread_id_t tid);
32 void clear_waiting_for();
34 void print_waiting_for(bool verbose = false);
35 void print_waited_by();
41 /* The set of threads this thread (tid) is waiting for */
42 thrd_id_set_t waiting_for;
44 /* The set of threads waiting for this thread */
45 thrd_id_set_t waited_by;
47 SnapVector<dist_map_t *> thrd_dist_maps;
48 SnapVector<node_set_t *> thrd_target_nodes;
50 /* Count the number of actions for threads that
51 * this thread is waiting for */
52 SnapVector<uint32_t> thrd_action_counters;
54 dist_map_t * getDistMap(thread_id_t tid);