X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=threads.cc;h=cbedbb18bae1d73db1c46a531b4141886875b6be;hb=dc9c89654982c64264dfee7b1ea23e9a5e88e18e;hp=1de548ccdb93ccd41a2a0248a49be2937dd87f01;hpb=e7c0c2dc248559b307122db7923df35f7c6d957e;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 */