From: Brian Norris Date: Fri, 10 Aug 2012 21:51:27 +0000 (-0700) Subject: model: remove useless return code from add_thread() X-Git-Tag: pldi2013~271^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4730dd573ad7a28d875c31b6aa633f7bce420054;p=model-checker.git model: remove useless return code from add_thread() --- diff --git a/libthreads.cc b/libthreads.cc index 2898258..98df424 100644 --- a/libthreads.cc +++ b/libthreads.cc @@ -11,14 +11,13 @@ int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg) { Thread *thread; - int ret; DBG(); thread = new Thread(t, start_routine, arg); - ret = model->add_thread(thread); + model->add_thread(thread); DEBUG("create thread %d\n", id_to_int(thrd_to_id(*t))); /* seq_cst is just a 'don't care' parameter */ model->switch_to_master(new ModelAction(THREAD_CREATE, std::memory_order_seq_cst, thread, VALUE_NONE)); - return ret; + return 0; } int thrd_join(thrd_t t) diff --git a/model.cc b/model.cc index 964e83f..a4f7e90 100644 --- a/model.cc +++ b/model.cc @@ -716,11 +716,15 @@ void ModelChecker::print_summary() printf("\n"); } -int ModelChecker::add_thread(Thread *t) +/** + * Add a Thread to the system for the first time. Should only be called once + * per thread. + * @param t The Thread to add + */ +void ModelChecker::add_thread(Thread *t) { thread_map->put(id_to_int(t->get_id()), t); scheduler->add_thread(t); - return 0; } void ModelChecker::remove_thread(Thread *t) diff --git a/model.h b/model.h index 86e0b1e..723ca43 100644 --- a/model.h +++ b/model.h @@ -52,7 +52,7 @@ public: Thread * schedule_next_thread(); - int add_thread(Thread *t); + void add_thread(Thread *t); void remove_thread(Thread *t); Thread * get_thread(thread_id_t tid) { return thread_map->get(id_to_int(tid)); }