From fe8423ca853f5d614e618fe49d37d0943d416809 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 23 Apr 2012 19:46:30 -0700 Subject: [PATCH] threads: don't make direct call into scheduler Since I need a ModelChecker::add_thread(Thread *) function anyway, I should direct add_thread() calls through the model-checker framework rather than the Scheduler class. This will make things a little cleaner and symmetric when I add a remove_thread() function. --- model.cc | 1 + threads.cc | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/model.cc b/model.cc index 1f13de7..f50b0f9 100644 --- a/model.cc +++ b/model.cc @@ -201,6 +201,7 @@ void ModelChecker::print_trace(void) int ModelChecker::add_thread(Thread *t) { thread_map[t->get_id()] = t; + scheduler->add_thread(t); return 0; } diff --git a/threads.cc b/threads.cc index 4c7ac41..3af7496 100644 --- a/threads.cc +++ b/threads.cc @@ -75,7 +75,6 @@ Thread::Thread(thrd_t *t, void (*func)(), void *a) { state = THREAD_CREATED; id = model->get_next_id(); *user_thread = id; - model->scheduler->add_thread(this); } Thread::Thread(thrd_t *t) { -- 2.34.1