Remove unused functions
[c11tester.git] / threads.cc
index 93160310466d6539d0863118c048e69ebbf7621d..aef263ec4624418c2fc050cd3a998e8ad80bd878 100644 (file)
@@ -333,7 +333,6 @@ int Thread::swap(ucontext_t *ctxt, Thread *t)
 
 int Thread::swap(Thread *t, Thread *t2)
 {
-       t->set_state(THREAD_READY);
        t2->set_state(THREAD_RUNNING);
        if (t == t2)
                return 0;
@@ -358,12 +357,12 @@ void Thread::freeResources() {
                stack_free(stack);
 #ifdef TLS
        if (this != model->getInitThread()) {
-               ASSERT(thread_current()==NULL);
                real_pthread_mutex_unlock(&mutex2);
                real_pthread_join(thread, NULL);
                stack_free(helper_stack);
        }
 #endif
+       state = THREAD_FREED;
 }
 
 /**
@@ -379,6 +378,7 @@ Thread::Thread(thread_id_t tid) :
        acq_fence_cv(new ClockVector()),
        creation(NULL),
        pending(NULL),
+       wakeup_state(false),
        start_routine(NULL),
        arg(NULL),
        stack(NULL),
@@ -405,6 +405,7 @@ Thread::Thread(thread_id_t tid, thrd_t *t, void (*func)(void *), void *a, Thread
        acq_fence_cv(new ClockVector()),
        creation(NULL),
        pending(NULL),
+       wakeup_state(false),
        start_routine(func),
        pstart_routine(NULL),
        arg(a),
@@ -438,6 +439,7 @@ Thread::Thread(thread_id_t tid, thrd_t *t, void *(*func)(void *), void *a, Threa
        acq_fence_cv(new ClockVector()),
        creation(NULL),
        pending(NULL),
+       wakeup_state(false),
        start_routine(NULL),
        pstart_routine(func),
        arg(a),