4 #include "threads-model.h"
6 /* forward declaration */
9 typedef ModelList<const ModelAction *> action_mlist_t;
10 typedef SnapList<uint32_t> func_id_list_t;
17 void enter_function(const uint32_t func_id, thread_id_t tid);
18 void exit_function(const uint32_t func_id, thread_id_t tid);
20 uint32_t get_func_counter() { return func_counter; }
21 void incr_func_counter() { func_counter++; }
23 void add_func_atomic(ModelAction *act, thread_id_t tid);
25 HashTable<const char *, uint32_t, uintptr_t, 4> * getFuncMap() { return &func_map; }
26 ModelVector< action_mlist_t * > * getFuncAtomics() { return &func_atomics; }
30 uint32_t func_counter;
32 /* map function names to integer ids */
33 HashTable<const char *, uint32_t, uintptr_t, 4> func_map;
35 ModelVector< action_mlist_t * > func_atomics;
37 /* Work_list stores a list of function ids for each thread.
38 * Each element in work_list is intended to be used as a stack storing
39 * the functions that thread i has entered and yet to exit from
41 SnapVector< func_id_list_t * > work_list;