Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 276ae57e1a71ef65a6fcc967ee08e33e8ad9a738)
+++ libcfa/src/concurrency/kernel.cfa	(revision ae7be7a5727c6a0974d8f0a4bf6bab4149b6c80d)
@@ -293,5 +293,5 @@
 			if(readyThread) {
 				/* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
-				/* paranoid */ verifyf( readyThread->state == Inactive || readyThread->state == Start || readyThread->preempted != __NO_PREEMPTION, "state : %d, preempted %d\n", readyThread->state, readyThread->preempted);
+				/* paranoid */ verifyf( readyThread->state == Blocked || readyThread->state == Start || readyThread->preempted != __NO_PREEMPTION, "state : %d, preempted %d\n", readyThread->state, readyThread->preempted);
 				/* paranoid */ verifyf( readyThread->next == 0p, "Expected null got %p", readyThread->next );
 
@@ -331,5 +331,5 @@
 	// set state of processor coroutine to inactive
 	verify(proc_cor->state == Active);
-	proc_cor->state = Inactive;
+	proc_cor->state = Blocked;
 
 	// Actually run the thread
@@ -339,5 +339,5 @@
 			verify(thrd_dst->state == Active || thrd_dst->state == Rerun);
 		} else {
-			verify(thrd_dst->state == Start || thrd_dst->state == Primed || thrd_dst->state == Inactive);
+			verify(thrd_dst->state == Start || thrd_dst->state == Primed || thrd_dst->state == Blocked);
 			thrd_dst->state = Active;
 		}
@@ -365,9 +365,7 @@
 		// 1 - Regular case : the thread has blocked and now one has scheduled it yet.
 		// 2 - Racy case    : the thread has blocked but someone has already tried to schedule it.
-		// 3 - Polite Racy case : the thread has blocked, someone has already tried to schedule it, but the thread is nice and wants to go through the ready-queue any way
 		// 4 - Preempted
 		// In case 1, we may have won a race so we can't write to the state again.
 		// In case 2, we lost the race so we now own the thread.
-		// In case 3, we lost the race but can just reschedule the thread.
 
 		if(unlikely(thrd_dst->preempted != __NO_PREEMPTION)) {
@@ -379,5 +377,6 @@
 		// set state of processor coroutine to active and the thread to inactive
 		static_assert(sizeof(thrd_dst->state) == sizeof(int));
-		enum coroutine_state old_state = __atomic_exchange_n(&thrd_dst->state, Inactive, __ATOMIC_SEQ_CST);
+		enum coroutine_state old_state = __atomic_exchange_n(&thrd_dst->state, Blocked, __ATOMIC_SEQ_CST);
+		__cfaabi_dbg_debug_do( thrd_dst->park_result = old_state; )
 		switch(old_state) {
 			case Halted:
@@ -398,5 +397,5 @@
 			default:
 				// This makes no sense, something is wrong abort
-				abort("Finished running a thread that was Inactive/Start/Primed %d\n", old_state);
+				abort("Finished running a thread that was Blocked/Start/Primed %d\n", old_state);
 		}
 	}
@@ -404,4 +403,5 @@
 	// Just before returning to the processor, set the processor coroutine to active
 	proc_cor->state = Active;
+	kernelTLS.this_thread = 0p;
 }
 
@@ -521,5 +521,5 @@
 
 	// set state of current coroutine to inactive
-	src->state = src->state == Halted ? Halted : Inactive;
+	src->state = src->state == Halted ? Halted : Blocked;
 
 	// context switch to specified coroutine
@@ -555,5 +555,5 @@
 	/* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
 	/* paranoid */ #if defined( __CFA_WITH_VERIFY__ )
-	/* paranoid */ if( thrd->state == Inactive || thrd->state == Start ) assertf( thrd->preempted == __NO_PREEMPTION,
+	/* paranoid */ if( thrd->state == Blocked || thrd->state == Start ) assertf( thrd->preempted == __NO_PREEMPTION,
 	                  "Error inactive thread marked as preempted, state %d, preemption %d\n", thrd->state, thrd->preempted );
 	/* paranoid */ if( thrd->preempted != __NO_PREEMPTION ) assertf(thrd->state == Active || thrd->state == Rerun,
@@ -561,4 +561,6 @@
 	/* paranoid */ #endif
 	/* paranoid */ verifyf( thrd->next == 0p, "Expected null got %p", thrd->next );
+
+	if (thrd->preempted == __NO_PREEMPTION) thrd->state = Ready;
 
 	lock  ( ready_queue_lock __cfaabi_dbg_ctx2 );
@@ -598,18 +600,19 @@
 	disable_interrupts();
 	static_assert(sizeof(thrd->state) == sizeof(int));
-	
+
 	// record activity
 	__cfaabi_dbg_record_thrd( *thrd, false, caller );
 
 	enum coroutine_state old_state = __atomic_exchange_n(&thrd->state, Rerun, __ATOMIC_SEQ_CST);
+	__cfaabi_dbg_debug_do( thrd->unpark_result = old_state; )
 	switch(old_state) {
 		case Active:
 			// Wake won the race, the thread will reschedule/rerun itself
 			break;
-		case Inactive:
+		case Blocked:
 			/* paranoid */ verify( ! thrd->preempted != __NO_PREEMPTION );
 
 			// Wake lost the race,
-			thrd->state = Inactive;
+			thrd->state = Blocked;
 			__schedule_thread( thrd );
 			break;
