fix conflicts
authorBrian Demsky <bdemsky@uci.edu>
Mon, 25 Feb 2013 07:25:59 +0000 (23:25 -0800)
committerBrian Demsky <bdemsky@uci.edu>
Mon, 25 Feb 2013 07:25:59 +0000 (23:25 -0800)
Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/model-checker

Conflicts:
schedule.cc

model.cc
schedule.cc
threads-model.h
threads.cc

index ae3788945c7756881178b1657bb215cf5a71901a..cec59d52a5579ba651ec2f97cacd689d87da34fe 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1111,7 +1111,7 @@ bool ModelChecker::process_thread_action(ModelAction *curr)
        case THREAD_CREATE: {
                thrd_t *thrd = (thrd_t *)curr->get_location();
                struct thread_params *params = (struct thread_params *)curr->get_value();
-               Thread *th = new Thread(thrd, params->func, params->arg);
+               Thread *th = new Thread(thrd, params->func, params->arg, get_thread(curr));
                add_thread(th);
                th->set_creation(curr);
                /* Promises can be satisfied by children */
index e87490313cf4836e1f11dab9528ef7ad00b6bf26..8dd13304093008094c00d465ffb4086eec1e810d 100644 (file)
@@ -215,7 +215,7 @@ void Scheduler::set_current_thread(Thread *t)
 {
        ASSERT(t && !t->is_model_thread());
 
-       curr_thread_index = id_to_int(t->get_id());
+       //curr_thread_index = id_to_int(t->get_id());
 
        current = t;
        if (DBG_ENABLED())
index fd0314ad6b9fa34ac5a42c0fd9cfd94f6f552753..30acd2deba1f50e27a15d1c2d74a649809cf004a 100644 (file)
@@ -41,7 +41,7 @@ class ModelAction;
 class Thread {
 public:
        Thread(thread_id_t tid);
-       Thread(thrd_t *t, void (*func)(void *), void *a);
+       Thread(thrd_t *t, void (*func)(void *), void *a, Thread * parent_thrd = NULL);
        ~Thread();
        void complete();
 
index 1de548ccdb93ccd41a2a0248a49be2937dd87f01..cbedbb18bae1d73db1c46a531b4141886875b6be 100644 (file)
@@ -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 */