threads: add per-thread "return" values for 'model-checking/user context' switch
[model-checker.git] / threads.cc
index 37b0f1a87ee6fb9ac975a84c8df9adf018d808c5..b6eaee4ea18cb511b9d4e37edc78814669e152c8 100644 (file)
@@ -19,6 +19,7 @@ static void stack_free(void *stack)
 
 Thread * thread_current(void)
 {
+       ASSERT(model);
        return model->scheduler->get_current_thread();
 }
 
@@ -68,7 +69,9 @@ void Thread::complete()
        }
 }
 
-Thread::Thread(thrd_t *t, void (*func)(void *), void *a) {
+Thread::Thread(thrd_t *t, void (*func)(void *), void *a) :
+       last_action_val(VALUE_NONE)
+{
        int ret;
 
        user_thread = t;