threads/model: move switch_to_master from class Thread to class ModelChecker
[model-checker.git] / libthreads.cc
index fd6259ad64d62474e0f7b7565cc72685e56288ad..7ed5491f675fe91d646a8bec1d056ae712ea2ab3 100644 (file)
@@ -23,14 +23,14 @@ int thrd_join(thrd_t t)
        Thread *th = model->get_thread(thrd_to_id(t));
        while (th->get_state() != THREAD_COMPLETED && !ret)
                /* seq_cst is just a 'don't care' parameter */
-               ret = thread_current()->switch_to_master(new ModelAction(THREAD_JOIN, memory_order_seq_cst, NULL, VALUE_NONE));
+               ret = model->switch_to_master(new ModelAction(THREAD_JOIN, memory_order_seq_cst, NULL, VALUE_NONE));
        return ret;
 }
 
 int thrd_yield(void)
 {
        /* seq_cst is just a 'don't care' parameter */
-       return thread_current()->switch_to_master(new ModelAction(THREAD_YIELD, memory_order_seq_cst, NULL, VALUE_NONE));
+       return model->switch_to_master(new ModelAction(THREAD_YIELD, memory_order_seq_cst, NULL, VALUE_NONE));
 }
 
 thrd_t thrd_current(void)