X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=threads.cc;h=dc2db2d9bfefcab57458035f3f4bc815b75b5fc5;hb=51d0154de2ac3c660a58c3f377f4092c6fd1621b;hp=e1f74bfbd210da803259b09300ca15f5db3f964e;hpb=0696cb09629cd168f122a2e134246d79c3c8fd2c;p=model-checker.git diff --git a/threads.cc b/threads.cc index e1f74bf..dc2db2d 100644 --- a/threads.cc +++ b/threads.cc @@ -2,9 +2,11 @@ * @brief Thread functions. */ -#include "libthreads.h" +#include + +#include #include "common.h" -#include "threads.h" +#include "threads-model.h" /* global "model" object */ #include "model.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.