X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=model.h;h=8d10d51e7e2138904ae415cf8fa11c06c959765e;hp=030d7ddf67723aa1878364e4a7f84c8898136f81;hb=db607bcf0c5a0608e2f8e3364ec1c062a48bee03;hpb=3262ae1f816dea735cab52d6940523f52ca80fe1 diff --git a/model.h b/model.h index 030d7ddf..8d10d51e 100644 --- a/model.h +++ b/model.h @@ -24,6 +24,9 @@ class NodeStack; class CycleGraph; class Promise; +/** @brief Shorthand for a list of release sequence heads */ +typedef std::vector< const ModelAction *, MyAlloc > rel_heads_list_t; + /** * Model checker parameter structure. Holds run-time configuration options for * the model checker. @@ -85,8 +88,7 @@ public: bool isfeasibleotherthanRMW(); bool isfinalfeasible(); void check_promises(ClockVector *old_cv, ClockVector * merge_cv); - void get_release_seq_heads(ModelAction *act, - std::vector< const ModelAction *, MyAlloc > *release_heads); + void get_release_seq_heads(ModelAction *act, rel_heads_list_t *release_heads); void finish_execution(); bool isfeasibleprefix(); void set_assert() {asserted=true;} @@ -112,8 +114,11 @@ private: */ void set_current_action(ModelAction *act) { priv->current_action = act; } Thread * check_current_action(ModelAction *curr); + ModelAction * initialize_curr_action(ModelAction *curr); bool process_read(ModelAction *curr, bool second_part_of_rmw); bool process_write(ModelAction *curr); + void process_mutex(ModelAction *curr); + bool check_action_enabled(ModelAction *curr); bool take_step(); @@ -130,14 +135,15 @@ private: void add_action_to_lists(ModelAction *act); ModelAction * get_last_action(thread_id_t tid); ModelAction * get_last_seq_cst(ModelAction *curr); + ModelAction * get_last_unlock(ModelAction *curr); void build_reads_from_past(ModelAction *curr); ModelAction * process_rmw(ModelAction *curr); void post_r_modification_order(ModelAction *curr, const ModelAction *rf); bool r_modification_order(ModelAction *curr, const ModelAction *rf); bool w_modification_order(ModelAction *curr); - bool release_seq_head(const ModelAction *rf, - std::vector< const ModelAction *, MyAlloc > *release_heads) const; + bool release_seq_head(const ModelAction *rf, rel_heads_list_t *release_heads) const; bool resolve_release_sequences(void *location, work_queue_t *work_queue); + void do_complete_join(ModelAction *join); ModelAction *diverge; @@ -149,6 +155,10 @@ private: * to a trace of all actions performed on the object. */ HashTable *obj_map; + /** Per-object list of actions. Maps an object (i.e., memory location) + * to a trace of all actions performed on the object. */ + HashTable *lock_waiters_map; + HashTable, uintptr_t, 4 > *obj_thrd_map; std::vector *promises; std::vector *futurevalues; @@ -160,7 +170,7 @@ private: * This structure maps its lists by object location. Each ModelAction * in the lists should be an acquire operation. */ - HashTable, uintptr_t, 4> *lazy_sync_with_release; + HashTable *lazy_sync_with_release; /** * Represents the total size of the