pthread: Panic if there is a bad thread state
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 26 Oct 2015 21:44:31 +0000 (17:44 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 28 Oct 2015 16:05:13 +0000 (12:05 -0400)
There's no reason to merely print here.  If the type is wrong, there is
a critical bug in the 2LS.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/pthread/pthread.c

index 1bb0dc8..961d087 100644 (file)
@@ -280,7 +280,7 @@ static void pth_thread_runnable(struct uthread *uthread)
                        /* can do whatever for each of these cases */
                        break;
                default:
-                       printf("Odd state %d for pthread %08p\n", pthread->state, pthread);
+                       panic("Odd state %d for pthread %08p\n", pthread->state, pthread);
        }
        pthread->state = PTH_RUNNABLE;
        /* Insert the newly created thread into the ready queue of threads.