Index: tests/concurrent/examples/.expect/datingService.txt
===================================================================
--- tests/concurrent/examples/.expect/datingService.txt	(revision cca568e32a0a35aff9eb80fa5e403e3d338d349e)
+++ tests/concurrent/examples/.expect/datingService.txt	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -1,40 +1,0 @@
-Girl:17 is dating Boy at 2 with ccode 17
- Boy:2 is dating Girl 17 with ccode 17
- Boy:14 is dating Girl 5 with ccode 5
-Girl:5 is dating Boy at 14 with ccode 5
- Boy:9 is dating Girl 10 with ccode 10
-Girl:10 is dating Boy at 9 with ccode 10
- Boy:1 is dating Girl 18 with ccode 18
-Girl:18 is dating Boy at 1 with ccode 18
- Boy:16 is dating Girl 3 with ccode 3
-Girl:3 is dating Boy at 16 with ccode 3
- Boy:5 is dating Girl 14 with ccode 14
-Girl:14 is dating Boy at 5 with ccode 14
- Boy:15 is dating Girl 4 with ccode 4
-Girl:4 is dating Boy at 15 with ccode 4
-Girl:0 is dating Boy at 19 with ccode 0
- Boy:19 is dating Girl 0 with ccode 0
-Girl:9 is dating Boy at 10 with ccode 9
- Boy:10 is dating Girl 9 with ccode 9
-Girl:11 is dating Boy at 8 with ccode 11
- Boy:8 is dating Girl 11 with ccode 11
- Boy:12 is dating Girl 7 with ccode 7
-Girl:7 is dating Boy at 12 with ccode 7
- Boy:11 is dating Girl 8 with ccode 8
-Girl:8 is dating Boy at 11 with ccode 8
-Girl:16 is dating Boy at 3 with ccode 16
- Boy:3 is dating Girl 16 with ccode 16
-Girl:15 is dating Boy at 4 with ccode 15
- Boy:4 is dating Girl 15 with ccode 15
-Girl:19 is dating Boy at 0 with ccode 19
- Boy:0 is dating Girl 19 with ccode 19
-Girl:2 is dating Boy at 17 with ccode 2
- Boy:17 is dating Girl 2 with ccode 2
- Boy:13 is dating Girl 6 with ccode 6
-Girl:6 is dating Boy at 13 with ccode 6
- Boy:7 is dating Girl 12 with ccode 12
-Girl:12 is dating Boy at 7 with ccode 12
-Girl:13 is dating Boy at 6 with ccode 13
- Boy:6 is dating Girl 13 with ccode 13
-Girl:1 is dating Boy at 18 with ccode 1
- Boy:18 is dating Girl 1 with ccode 1
Index: tests/concurrent/examples/datingService.cfa
===================================================================
--- tests/concurrent/examples/datingService.cfa	(revision cca568e32a0a35aff9eb80fa5e403e3d338d349e)
+++ tests/concurrent/examples/datingService.cfa	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -1,5 +1,5 @@
 //
 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
-// 
+//
 // The contents of this file are covered under the licence agreement in the
 // file "LICENCE" distributed with Cforall.
@@ -35,5 +35,5 @@
 		signal_block( Boys[ccode] );					// restart boy to set phone number
 	} // if
-	sout | "Girl:" | PhoneNo | "is dating Boy at" | BoyPhoneNo | "with ccode" | ccode;
+	//sout | "Girl:" | PhoneNo | "is dating Boy at" | BoyPhoneNo | "with ccode" | ccode;
 	return BoyPhoneNo;
 } // DatingService girl
@@ -47,5 +47,5 @@
 		signal_block( Girls[ccode] );					// restart girl to set phone number
 	} // if
-	sout | " Boy:" | PhoneNo | "is dating Girl" | GirlPhoneNo | "with ccode" | ccode;
+	//sout | " Boy:" | PhoneNo | "is dating Girl" | GirlPhoneNo | "with ccode" | ccode;
 	return GirlPhoneNo;
 } // DatingService boy
Index: tests/concurrent/multi-monitor.cfa
===================================================================
--- tests/concurrent/multi-monitor.cfa	(revision cca568e32a0a35aff9eb80fa5e403e3d338d349e)
+++ tests/concurrent/multi-monitor.cfa	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -11,5 +11,9 @@
 
 void increment( monitor_t & mutex p1, monitor_t & mutex p2, int & value ) {
+	assert(active_thread() == get_monitor(p1)->owner);
+	assert(active_thread() == get_monitor(p2)->owner);
 	value += 1;
+	assert(active_thread() == get_monitor(p1)->owner);
+	assert(active_thread() == get_monitor(p2)->owner);
 }
 
Index: tests/concurrent/park/.expect/contention.txt
===================================================================
--- tests/concurrent/park/.expect/contention.txt	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
+++ tests/concurrent/park/.expect/contention.txt	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -0,0 +1,21 @@
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done
+Done Unparker
Index: tests/concurrent/park/.expect/force_preempt.txt
===================================================================
--- tests/concurrent/park/.expect/force_preempt.txt	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
+++ tests/concurrent/park/.expect/force_preempt.txt	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -0,0 +1,150 @@
+0 Calling unpark (No Force) 0
+1 Calling unpark (No Force) 0
+2 Calling unpark (No Force) 0
+3 Calling unpark (No Force) 0
+4 Calling unpark (No Force) 0
+0 Parking (No Force) 0
+0 Unparked (No Force) 0
+0 Calling unpark (No Force) 1
+1 Parking (No Force) 0
+1 Unparked (No Force) 0
+1 Calling unpark (No Force) 1
+2 Parking (No Force) 0
+2 Unparked (No Force) 0
+2 Calling unpark (No Force) 1
+3 Parking (No Force) 0
+3 Unparked (No Force) 0
+3 Calling unpark (No Force) 1
+4 Parking (No Force) 0
+4 Unparked (No Force) 0
+4 Calling unpark (No Force) 1
+0 Parking (No Force) 1
+0 Unparked (No Force) 1
+0 Calling unpark (No Force) 2
+1 Parking (No Force) 1
+1 Unparked (No Force) 1
+1 Calling unpark (No Force) 2
+2 Parking (No Force) 1
+2 Unparked (No Force) 1
+2 Calling unpark (No Force) 2
+3 Parking (No Force) 1
+3 Unparked (No Force) 1
+3 Calling unpark (No Force) 2
+4 Parking (No Force) 1
+4 Unparked (No Force) 1
+4 Calling unpark (No Force) 2
+0 Parking (No Force) 2
+0 Unparked (No Force) 2
+0 Calling unpark (No Force) 3
+1 Parking (No Force) 2
+1 Unparked (No Force) 2
+1 Calling unpark (No Force) 3
+2 Parking (No Force) 2
+2 Unparked (No Force) 2
+2 Calling unpark (No Force) 3
+3 Parking (No Force) 2
+3 Unparked (No Force) 2
+3 Calling unpark (No Force) 3
+4 Parking (No Force) 2
+4 Unparked (No Force) 2
+4 Calling unpark (No Force) 3
+0 Parking (No Force) 3
+0 Unparked (No Force) 3
+0 Calling unpark (No Force) 4
+1 Parking (No Force) 3
+1 Unparked (No Force) 3
+1 Calling unpark (No Force) 4
+2 Parking (No Force) 3
+2 Unparked (No Force) 3
+2 Calling unpark (No Force) 4
+3 Parking (No Force) 3
+3 Unparked (No Force) 3
+3 Calling unpark (No Force) 4
+4 Parking (No Force) 3
+4 Unparked (No Force) 3
+4 Calling unpark (No Force) 4
+0 Parking (No Force) 4
+0 Unparked (No Force) 4
+0 Calling unpark (Force) 0
+1 Parking (No Force) 4
+1 Unparked (No Force) 4
+1 Calling unpark (Force) 0
+2 Parking (No Force) 4
+2 Unparked (No Force) 4
+2 Calling unpark (Force) 0
+3 Parking (No Force) 4
+3 Unparked (No Force) 4
+3 Calling unpark (Force) 0
+4 Parking (No Force) 4
+4 Unparked (No Force) 4
+4 Calling unpark (Force) 0
+0 Parking (Force) 0
+1 Parking (Force) 0
+2 Parking (Force) 0
+3 Parking (Force) 0
+4 Parking (Force) 0
+0 Unparked (Force) 0
+0 Calling unpark (Force) 1
+1 Unparked (Force) 0
+1 Calling unpark (Force) 1
+2 Unparked (Force) 0
+2 Calling unpark (Force) 1
+3 Unparked (Force) 0
+3 Calling unpark (Force) 1
+4 Unparked (Force) 0
+4 Calling unpark (Force) 1
+0 Parking (Force) 1
+1 Parking (Force) 1
+2 Parking (Force) 1
+3 Parking (Force) 1
+4 Parking (Force) 1
+0 Unparked (Force) 1
+0 Calling unpark (Force) 2
+1 Unparked (Force) 1
+1 Calling unpark (Force) 2
+2 Unparked (Force) 1
+2 Calling unpark (Force) 2
+3 Unparked (Force) 1
+3 Calling unpark (Force) 2
+4 Unparked (Force) 1
+4 Calling unpark (Force) 2
+0 Parking (Force) 2
+1 Parking (Force) 2
+2 Parking (Force) 2
+3 Parking (Force) 2
+4 Parking (Force) 2
+0 Unparked (Force) 2
+0 Calling unpark (Force) 3
+1 Unparked (Force) 2
+1 Calling unpark (Force) 3
+2 Unparked (Force) 2
+2 Calling unpark (Force) 3
+3 Unparked (Force) 2
+3 Calling unpark (Force) 3
+4 Unparked (Force) 2
+4 Calling unpark (Force) 3
+0 Parking (Force) 3
+1 Parking (Force) 3
+2 Parking (Force) 3
+3 Parking (Force) 3
+4 Parking (Force) 3
+0 Unparked (Force) 3
+0 Calling unpark (Force) 4
+1 Unparked (Force) 3
+1 Calling unpark (Force) 4
+2 Unparked (Force) 3
+2 Calling unpark (Force) 4
+3 Unparked (Force) 3
+3 Calling unpark (Force) 4
+4 Unparked (Force) 3
+4 Calling unpark (Force) 4
+0 Parking (Force) 4
+1 Parking (Force) 4
+2 Parking (Force) 4
+3 Parking (Force) 4
+4 Parking (Force) 4
+0 Unparked (Force) 4
+1 Unparked (Force) 4
+2 Unparked (Force) 4
+3 Unparked (Force) 4
+4 Unparked (Force) 4
Index: tests/concurrent/park/contention.cfa
===================================================================
--- tests/concurrent/park/contention.cfa	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
+++ tests/concurrent/park/contention.cfa	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -0,0 +1,62 @@
+#include <kernel.hfa>
+#include <thread.hfa>
+
+thread_local drand48_data buffer = { 0 };
+int myrand() {
+	long int result;
+	lrand48_r(&buffer, &result);
+	return result;
+}
+
+
+thread Thread {};
+void ^?{}(Thread & mutex this) {}
+
+enum Constants { blocked_size = 20 };
+Thread * volatile blocked[blocked_size];
+
+void main( Thread & this ) {
+	for(int i = 0; i < 1000; i++) {
+		int idx = myrand() % blocked_size;
+		if(blocked[idx]) {
+			Thread * thrd = __atomic_exchange_n(&blocked[idx], 0p, __ATOMIC_SEQ_CST);
+			unpark( *thrd );
+		} else {
+			Thread * thrd = __atomic_exchange_n(&blocked[idx], &this, __ATOMIC_SEQ_CST);
+			unpark( *thrd);
+			park();
+		}
+	}
+	printf("Done\n");
+}
+
+// Extra thread to avoid deadlocking
+thread Unparker {};
+
+void main( Unparker & this ) {
+	while(true) {
+		waitfor( ^?{} : this ) {
+			break;
+		} or else {
+			int idx = myrand() % blocked_size;
+			Thread * thrd = __atomic_exchange_n(&blocked[idx], 0p, __ATOMIC_SEQ_CST);
+			unpark( *thrd );
+			yield( myrand() % 20 );
+		}
+	}
+	printf("Done Unparker\n");
+}
+
+
+int main() {
+	for(i ; blocked_size) {
+		blocked[i] = 0p;
+	}
+
+	processor p[3];
+
+	Unparker u;
+	{
+		Thread t[20];
+	}
+}
Index: tests/concurrent/park/force_preempt.cfa
===================================================================
--- tests/concurrent/park/force_preempt.cfa	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
+++ tests/concurrent/park/force_preempt.cfa	(revision 3381ed7a703d0c964d6e94bffab7c58f0cdf0d17)
@@ -0,0 +1,57 @@
+#include <thread.hfa>
+#include <fstream.hfa>
+
+volatile int global = 0;
+
+thread Poller {};
+void main(Poller & this) {
+	while(true) {
+		waitfor( ^?{} : this ) {
+			break;
+		} or else {
+			global = (global + 1) % 10;
+			yield();
+		}
+	}
+}
+
+thread Waiter;
+thread Waiter {};
+
+
+void park_loop(Waiter & this, int id, bool force) {
+	for(int i = 0; i < 5; i++) {
+		// Unpark this thread, don't force a yield
+		sout | id | "Calling unpark" | (force ? "(Force)" : "(No Force)") | i;
+		unpark(this, force);
+
+		// Force a preemption before the call to park
+		int prev = global;
+		while(prev == global) {}
+
+		// Park this thread,
+		sout | id | "Parking"  | (force ? "(Force)" : "(No Force)") | i;
+		park();
+		sout | id | "Unparked" | (force ? "(Force)" : "(No Force)") | i;
+	}
+}
+
+volatile int count = 0;
+
+void main(Waiter & this) {
+	// Get a unique id
+	int id = __atomic_fetch_add(&count, 1, __ATOMIC_SEQ_CST);
+
+	// First without forcing yield
+	park_loop( this, id, false );
+
+	// First with forcing yield
+	park_loop( this, id, true  );
+}
+
+int main() {
+	Poller p;
+	{
+		Waiter waiters[5];
+	}
+}
