X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=threads.cc;h=cbedbb18bae1d73db1c46a531b4141886875b6be;hb=0997f5bf1b28a79066ed4abfed57f14419ee44d3;hp=1de548ccdb93ccd41a2a0248a49be2937dd87f01;hpb=30999f20b8426081e676adfc76d1c4af7b941e8e;p=model-checker.git diff --git a/threads.cc b/threads.cc index 1de548c..cbedbb1 100644 --- a/threads.cc +++ b/threads.cc @@ -151,7 +151,7 @@ Thread::Thread(thread_id_t tid) : * @param func The function that the thread will call. * @param a The parameter to pass to this function. */ -Thread::Thread(thrd_t *t, void (*func)(void *), void *a) : +Thread::Thread(thrd_t *t, void (*func)(void *), void *a, Thread * parent_thrd) : creation(NULL), pending(NULL), start_routine(func), @@ -171,7 +171,7 @@ Thread::Thread(thrd_t *t, void (*func)(void *), void *a) : id = model->get_next_id(); user_thread->priv = this; - parent = thread_current(); + parent = parent_thrd ? parent_thrd : thread_current(); } /** Destructor */