X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=threads.cc;h=7f515159f78052727180b1be6d82ba1df7e9ebac;hb=7e44b12a812b12b75ae1613b8ce26be8f0efcde3;hp=e1f74bfbd210da803259b09300ca15f5db3f964e;hpb=0696cb09629cd168f122a2e134246d79c3c8fd2c;p=model-checker.git diff --git a/threads.cc b/threads.cc index e1f74bf..7f51515 100644 --- a/threads.cc +++ b/threads.cc @@ -2,6 +2,8 @@ * @brief Thread functions. */ +#include + #include "libthreads.h" #include "common.h" #include "threads.h" @@ -112,6 +114,31 @@ void Thread::complete() } } +/** + * @brief Construct a new model-checker Thread + * + * A model-checker Thread is used for accounting purposes only. It will never + * have its own stack, and it should never be inserted into the Scheduler. + * + * @param tid The thread ID to assign + */ +Thread::Thread(thread_id_t tid) : + parent(NULL), + creation(NULL), + pending(NULL), + start_routine(NULL), + arg(NULL), + stack(NULL), + user_thread(NULL), + id(tid), + state(THREAD_READY), /* Thread is always ready? */ + wait_list(), + last_action_val(0), + model_thread(true) +{ + memset(&context, 0, sizeof(context)); +} + /** * Construct a new thread. * @param t The thread identifier of the newly created thread.