uint64_t model_rmwr_action_helper(void *obj, int atomic_index, const char *position) {
ensureModel();
- return model->switch_to_master(new ModelAction(ATOMIC_RMWR, position, orders[atomic_index], obj));
+ return model->switch_thread(new ModelAction(ATOMIC_RMWR, position, orders[atomic_index], obj));
}
void model_rmw_action_helper(void *obj, uint64_t val, int atomic_index, const char * position) {
ensureModel();
- model->switch_to_master(new ModelAction(ATOMIC_RMW, position, orders[atomic_index], obj, val));
+ model->switch_thread(new ModelAction(ATOMIC_RMW, position, orders[atomic_index], obj, val));
}
void model_rmwc_action_helper(void *obj, int atomic_index, const char *position) {
#define CDSATOMICSTORE(size) \
void cds_atomic_store ## size(void * obj, uint ## size ## _t val, int atomic_index, const char * position) { \
ensureModel(); \
- model->switch_to_master(new ModelAction(ATOMIC_WRITE, position, orders[atomic_index], obj, (uint64_t) val)); \
+ model->switch_thread(new ModelAction(ATOMIC_WRITE, position, orders[atomic_index], obj, (uint64_t) val)); \
*((volatile uint ## size ## _t *)obj) = val; \
thread_id_t tid = thread_current()->get_id(); \
for(int i=0;i < size / 8;i++) { \
Thread* next = getNextThread();
if (next != nullptr)
handleNewValidThread(old, next);
- else
+ else {
+ old->set_state(THREAD_READY); // Just to avoid the first ASSERT in ModelExecution::take_step
handleChosenThread(old);
+ }
return old->get_return_value();
}
initstate(423121, random_state, sizeof(random_state));
checkfree = params.checkthreshold;
for(int exec = 0;exec < params.maxexecutions;exec++) {
+ chosen_thread = init_thread;
do {
- chosen_thread = init_thread;
thread_chosen = false;
curr_thread_num = 1;
startRunExecution(&system_context);
Thread * curr_thread = thread_current();
/* Add dummy "start" action, just to create a first clock vector */
- model->switch_to_master(new ModelAction(THREAD_START, std::memory_order_seq_cst, curr_thread));
+ model->switch_thread(new ModelAction(THREAD_START, std::memory_order_seq_cst, curr_thread));
real_init_all();