X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=newfuzzer.h;h=db25cfd8744a8801ba4015de686c7c8199025cf4;hp=1973cb4a4e30ec2131e0e39544fea0c6d82585d8;hb=f45f762b63824c0e6e115bf456a853e36a5ca370;hpb=1ae389ef6461ae68d09a54ade74a1743df0b4901 diff --git a/newfuzzer.h b/newfuzzer.h index 1973cb4a..db25cfd8 100644 --- a/newfuzzer.h +++ b/newfuzzer.h @@ -12,18 +12,20 @@ class NewFuzzer : public Fuzzer { public: NewFuzzer(); int selectWrite(ModelAction *read, SnapVector* rf_set); - Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst); Predicate * get_selected_child_branch(thread_id_t tid); - bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector * rf_set, inst_act_map_t * inst_act_map); + void conditional_sleep(Thread * thread); + bool has_paused_threads(); + void wake_up_paused_threads(int * threadlist, int * numthreads); Thread * selectThread(int * threadlist, int numthreads); Thread * selectNotify(action_list_t * waiters); - bool shouldSleep(const ModelAction *sleep); - bool shouldWake(const ModelAction *sleep); + bool shouldSleep(const ModelAction * sleep); + bool shouldWake(const ModelAction * sleep); + bool shouldWait(const ModelAction * wait); void register_engine(ModelHistory * history, ModelExecution * execution); - MEMALLOC + SNAPSHOTALLOC private: ModelHistory * history; ModelExecution * execution; @@ -31,7 +33,15 @@ private: SnapVector thrd_last_read_act; SnapVector thrd_curr_pred; SnapVector thrd_selected_child_branch; - SnapVector< SnapVector * > thrd_pruned_writes; + SnapVector< SnapVector *> thrd_pruned_writes; + + bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector * rf_set, inst_act_map_t * inst_act_map); + Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst); + + /* Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate. + * Only used by selectWrite; + */ + SnapVector paused_thread_set; }; #endif /* end of __NEWFUZZER_H__ */