threads: add is_complete() helper function
[model-checker.git] / threads.cc
index b3a1d5599fb541d340184e0e2ba0f7589c0ec5ae..a9395926816f38bc4872019a3047357574c1e2b9 100644 (file)
@@ -104,7 +104,7 @@ int Thread::swap(ucontext_t *ctxt, Thread *t)
 /** Terminate a thread and free its stack. */
 void Thread::complete()
 {
-       if (state != THREAD_COMPLETED) {
+       if (!is_complete()) {
                DEBUG("completed thread %d\n", get_id());
                state = THREAD_COMPLETED;
                if (stack)