X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=schedule.cc;fp=schedule.cc;h=2ef4c4d2f968ef2c97dffbf8f17a3e80c447c9cd;hp=136f4622fb3ff1d16aa59a8b9d41a6c62df2f930;hb=bf80445c97bd34afcfd208cc3ecb31edcd631bb6;hpb=a6ce579c6437ebead8fee2c8df1530d223591318 diff --git a/schedule.cc b/schedule.cc index 136f462..2ef4c4d 100644 --- a/schedule.cc +++ b/schedule.cc @@ -6,6 +6,7 @@ #include "common.h" #include "model.h" #include "nodestack.h" +#include "execution.h" /** * Format an "enabled_type_t" for printing @@ -35,6 +36,7 @@ void enabled_type_to_string(enabled_type_t e, char *str) /** Constructor */ Scheduler::Scheduler() : + execution(NULL), enabled(NULL), enabled_len(0), curr_thread_index(0), @@ -42,6 +44,15 @@ Scheduler::Scheduler() : { } +/** + * @brief Register the ModelExecution engine + * @param execution The ModelExecution which is controlling execution + */ +void Scheduler::register_engine(ModelExecution *execution) +{ + this->execution = execution; +} + void Scheduler::set_enabled(Thread *t, enabled_type_t enabled_status) { int threadid = id_to_int(t->get_id()); if (threadid >= enabled_len) { @@ -56,7 +67,7 @@ void Scheduler::set_enabled(Thread *t, enabled_type_t enabled_status) { } enabled[threadid] = enabled_status; if (enabled_status == THREAD_DISABLED) - model->check_promises_thread_disabled(); + execution->check_promises_thread_disabled(); } /**