Need to allow for one spare encoding for the non-executed case with no suitable stores.
[satcheck.git] / threads.cc
index b7927c465d1156eddfa0103363e3b37f785d64b2..a3497e09f2b3693ac757f21cdb68851ded13fe84 100644 (file)
 /** Allocate a stack for a new thread. */
 static void * stack_allocate(size_t size)
 {
+       // TODO: This could be a bug if we have programs that start threads
+       // in different orders.  The solution is to use the same strategy
+       // the ALLOC action uses.
+
        return snapshot_malloc(size);
 }
 
@@ -109,7 +113,7 @@ Thread::Thread(thread_id_t tid) :
        user_thread(NULL),
        waiting(NULL),
        id(tid),
-       state(THREAD_READY), /* Thread is always ready? */
+       state(THREAD_READY),                    /* Thread is always ready? */
        model_thread(true)
 {
        memset(&context, 0, sizeof(context));
@@ -189,7 +193,7 @@ void Thread::set_waiting(Thread *th) {
  */
 bool Thread::is_waiting_on(const Thread *t) {
        Thread *wait;
-       for (wait = waiting_on(); wait != NULL; wait = wait->waiting_on())
+       for (wait = waiting_on();wait != NULL;wait = wait->waiting_on())
                if (wait == t)
                        return true;
        return false;