X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=model.cc;h=1015701d917803c75541fb2d3b830a0f223c301c;hb=e1430f3d41e01fca5b878fc5909cf1c871c12f0e;hp=42d31b385c5fab84d2bed8eafc54286c1885e510;hpb=24ac8e855acce4248271ca4a13f0dad8e74a96a4;p=model-checker.git diff --git a/model.cc b/model.cc index 42d31b3..1015701 100644 --- a/model.cc +++ b/model.cc @@ -55,6 +55,18 @@ int ModelChecker::add_thread(Thread *t) return 0; } +int ModelChecker::switch_to_master(ModelAction *act) +{ + Thread *old, *next; + + DBG(); + old = thread_current(); + set_current_action(act); + old->set_state(THREAD_READY); + next = system_thread; + return old->swap(next); +} + ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value) { Thread *t = thread_current();