8 #include "libthreads.h"
15 typedef enum action_type {
25 ModelAction(action_type_t type, memory_order order, void *loc, int value);
28 thread_id_t get_tid() { return tid; }
29 action_type get_type() { return type; }
30 memory_order get_mo() { return order; }
31 void *get_location() { return location; }
33 TreeNode *get_node() { return node; }
34 void set_node(TreeNode *n) { node = n; }
48 class Scheduler *scheduler;
49 Thread *system_thread;
51 void add_system_thread(Thread *t);
53 void set_current_action(ModelAction *act) { current_action = act; }
54 void check_current_action(void);
55 void print_trace(void);
57 int add_thread(Thread *t);
58 Thread *get_thread(thread_id_t tid) { return thread_map[tid]; }
60 void assign_id(Thread *t);
62 int switch_to_master(ModelAction *act);
65 class ModelAction *current_action;
66 std::list<class ModelAction *> action_trace;
67 std::map<thread_id_t, class Thread *> thread_map;
68 class TreeNode *rootNode, *currentNode;
71 extern ModelChecker *model;
73 int thread_switch_to_master(ModelAction *act);
75 #endif /* __MODEL_H__ */