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(thread_id_t other, FuncNode * node);
21 void remove_waited_by(thread_id_t other);
23 thrd_id_set_t * getWaitingFor() { return &waiting_for; }
24 thrd_id_set_t * getWaitedBy() { return &waited_by; }
26 node_set_t * getTargetNodes(thread_id_t tid);
27 int lookup_dist(thread_id_t tid, FuncNode * target);
28 int lookup_dist(thread_id_t other_tid);
31 void print_waiting_for();
32 void print_waited_by();
38 /* The set of threads this thread (tid) is waiting for */
39 thrd_id_set_t waiting_for;
41 /* The set of threads waiting for this thread */
42 thrd_id_set_t waited_by;
44 SnapVector<dist_map_t *> thrd_dist_maps;
45 SnapVector<node_set_t *> thrd_target_nodes;
47 dist_map_t * getDistMap(thread_id_t tid);