Index: generic/src/synch/waitq.c
===================================================================
--- generic/src/synch/waitq.c	(revision 4fded58aa3e9d077e85ec03f4c86b755c84c174a)
+++ generic/src/synch/waitq.c	(revision e7ed98680bd5e7de4b6d0a2a5bed181a601437e5)
@@ -225,18 +225,20 @@
 	ipl = interrupts_disable();
 
-	/*
-	 * Busy waiting for a delayed timeout.
-	 * This is an important fix for the race condition between
-	 * a delayed timeout and a next call to waitq_sleep_timeout().
-	 * Simply, the thread is not allowed to go to sleep if
-	 * there are timeouts in progress.
-	 */
-	spinlock_lock(&THREAD->lock);
-	if (THREAD->timeout_pending) {
+	if (THREAD) {	/* needed during system initiailzation */
+		/*
+		 * Busy waiting for a delayed timeout.
+		 * This is an important fix for the race condition between
+		 * a delayed timeout and a next call to waitq_sleep_timeout().
+		 * Simply, the thread is not allowed to go to sleep if
+		 * there are timeouts in progress.
+		 */
+		spinlock_lock(&THREAD->lock);
+		if (THREAD->timeout_pending) {
+			spinlock_unlock(&THREAD->lock);
+			interrupts_restore(ipl);
+			goto restart;
+		}
 		spinlock_unlock(&THREAD->lock);
-		interrupts_restore(ipl);
-		goto restart;
-	}
-	spinlock_unlock(&THREAD->lock);
+	}
 													
 	spinlock_lock(&wq->lock);
