Index: src/tests/.expect/concurrent/sched-int-barge.txt
===================================================================
--- src/tests/.expect/concurrent/sched-int-barge.txt	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
+++ src/tests/.expect/concurrent/sched-int-barge.txt	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -0,0 +1,100 @@
+1000
+2000
+3000
+4000
+5000
+6000
+7000
+8000
+9000
+10000
+11000
+12000
+13000
+14000
+15000
+16000
+17000
+18000
+19000
+20000
+21000
+22000
+23000
+24000
+25000
+26000
+27000
+28000
+29000
+30000
+31000
+32000
+33000
+34000
+35000
+36000
+37000
+38000
+39000
+40000
+41000
+42000
+43000
+44000
+45000
+46000
+47000
+48000
+49000
+50000
+51000
+52000
+53000
+54000
+55000
+56000
+57000
+58000
+59000
+60000
+61000
+62000
+63000
+64000
+65000
+66000
+67000
+68000
+69000
+70000
+71000
+72000
+73000
+74000
+75000
+76000
+77000
+78000
+79000
+80000
+81000
+82000
+83000
+84000
+85000
+86000
+87000
+88000
+89000
+90000
+91000
+92000
+93000
+94000
+95000
+96000
+97000
+98000
+99000
+100000
Index: src/tests/.expect/concurrent/sched-int-disjoint.txt
===================================================================
--- src/tests/.expect/concurrent/sched-int-disjoint.txt	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
+++ src/tests/.expect/concurrent/sched-int-disjoint.txt	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -0,0 +1,101 @@
+1000
+2000
+3000
+4000
+5000
+6000
+7000
+8000
+9000
+10000
+11000
+12000
+13000
+14000
+15000
+16000
+17000
+18000
+19000
+20000
+21000
+22000
+23000
+24000
+25000
+26000
+27000
+28000
+29000
+30000
+31000
+32000
+33000
+34000
+35000
+36000
+37000
+38000
+39000
+40000
+41000
+42000
+43000
+44000
+45000
+46000
+47000
+48000
+49000
+50000
+51000
+52000
+53000
+54000
+55000
+56000
+57000
+58000
+59000
+60000
+61000
+62000
+63000
+64000
+65000
+66000
+67000
+68000
+69000
+70000
+71000
+72000
+73000
+74000
+75000
+76000
+77000
+78000
+79000
+80000
+81000
+82000
+83000
+84000
+85000
+86000
+87000
+88000
+89000
+90000
+91000
+92000
+93000
+94000
+95000
+96000
+97000
+98000
+99000
+100000
+All waiter done
Index: src/tests/.expect/concurrent/sched-int-multi.txt
===================================================================
--- src/tests/.expect/concurrent/sched-int-multi.txt	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ 	(revision )
@@ -1,100 +1,0 @@
-1000
-2000
-3000
-4000
-5000
-6000
-7000
-8000
-9000
-10000
-11000
-12000
-13000
-14000
-15000
-16000
-17000
-18000
-19000
-20000
-21000
-22000
-23000
-24000
-25000
-26000
-27000
-28000
-29000
-30000
-31000
-32000
-33000
-34000
-35000
-36000
-37000
-38000
-39000
-40000
-41000
-42000
-43000
-44000
-45000
-46000
-47000
-48000
-49000
-50000
-51000
-52000
-53000
-54000
-55000
-56000
-57000
-58000
-59000
-60000
-61000
-62000
-63000
-64000
-65000
-66000
-67000
-68000
-69000
-70000
-71000
-72000
-73000
-74000
-75000
-76000
-77000
-78000
-79000
-80000
-81000
-82000
-83000
-84000
-85000
-86000
-87000
-88000
-89000
-90000
-91000
-92000
-93000
-94000
-95000
-96000
-97000
-98000
-99000
-100000
Index: src/tests/.expect/concurrent/sched-int.txt
===================================================================
--- src/tests/.expect/concurrent/sched-int.txt	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ 	(revision )
@@ -1,101 +1,0 @@
-1000
-2000
-3000
-4000
-5000
-6000
-7000
-8000
-9000
-10000
-11000
-12000
-13000
-14000
-15000
-16000
-17000
-18000
-19000
-20000
-21000
-22000
-23000
-24000
-25000
-26000
-27000
-28000
-29000
-30000
-31000
-32000
-33000
-34000
-35000
-36000
-37000
-38000
-39000
-40000
-41000
-42000
-43000
-44000
-45000
-46000
-47000
-48000
-49000
-50000
-51000
-52000
-53000
-54000
-55000
-56000
-57000
-58000
-59000
-60000
-61000
-62000
-63000
-64000
-65000
-66000
-67000
-68000
-69000
-70000
-71000
-72000
-73000
-74000
-75000
-76000
-77000
-78000
-79000
-80000
-81000
-82000
-83000
-84000
-85000
-86000
-87000
-88000
-89000
-90000
-91000
-92000
-93000
-94000
-95000
-96000
-97000
-98000
-99000
-100000
-All waiter done
Index: src/tests/Makefile.am
===================================================================
--- src/tests/Makefile.am	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ src/tests/Makefile.am	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -22,5 +22,5 @@
 concurrent=yes
 quick_test+= coroutine thread monitor
-concurrent_test=coroutine thread monitor multi-monitor sched-int sched-int-multi sched-int-multi2 sched-ext sched-ext-multi preempt
+concurrent_test=coroutine thread monitor multi-monitor sched-int-disjoint sched-int-barge sched-int-wait sched-ext sched-ext-multi preempt
 else
 concurrent=no
Index: src/tests/Makefile.in
===================================================================
--- src/tests/Makefile.in	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ src/tests/Makefile.in	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -230,5 +230,5 @@
 @BUILD_CONCURRENCY_TRUE@concurrent = yes
 @BUILD_CONCURRENCY_FALSE@concurrent_test = 
-@BUILD_CONCURRENCY_TRUE@concurrent_test = coroutine thread monitor multi-monitor sched-int sched-int-multi sched-int-multi2 sched-ext sched-ext-multi preempt
+@BUILD_CONCURRENCY_TRUE@concurrent_test = coroutine thread monitor multi-monitor sched-int-disjoint sched-int-barge sched-int-wait sched-ext sched-ext-multi preempt
 
 # applies to both programs
Index: src/tests/sched-int-barge.c
===================================================================
--- src/tests/sched-int-barge.c	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
+++ src/tests/sched-int-barge.c	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -0,0 +1,97 @@
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <stdlib>
+#include <thread>
+
+enum state_t { WAIT, SIGNAL, BARGE };
+
+monitor global_t {};
+
+monitor global_data_t {
+	bool done;
+	int counter;
+	state_t state;
+
+	unsigned short do_signal;
+	unsigned short do_wait2;
+	unsigned short do_wait1;
+};
+
+void ?{} ( global_data_t * this ) {
+	this->done = false;
+	this->counter = 0;
+	this->state = BARGE;
+
+	this->do_signal = 6;
+	this->do_wait1  = 1;
+	this->do_wait2  = 3;
+}
+
+void ^?{} ( global_data_t * this ) {}
+
+global_t globalA;
+global_t globalB;
+global_data_t globalC;
+
+condition cond;
+
+thread Threads {};
+
+bool logicC( global_t * mutex a, global_t * mutex b, global_data_t * mutex c ) {
+	c->counter++;
+
+	if( (c->counter % 1000) == 0 ) sout | c->counter | endl;
+
+	int action = c->counter % 10;
+
+	if( action == 0 ) {
+		c->do_signal = max( ((unsigned)rand48()) % 10, 1);
+		c->do_wait1 = ((unsigned)rand48()) % (c->do_signal);
+		c->do_wait2 = ((unsigned)rand48()) % (c->do_signal);
+
+		// if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
+	}
+
+	if( action == c->do_wait1 || action == c->do_wait2 ) {
+		c->state = WAIT;
+		wait( &cond );
+
+		if(c->state != SIGNAL) {
+			sout | "ERROR Barging detected" | c->counter | endl;
+			abort();
+		}
+	}
+	else if( action == c->do_signal ) {
+		c->state = SIGNAL;
+
+		signal( &cond );
+		signal( &cond );
+	}
+	else {
+		c->state = BARGE;
+	}
+
+	if( c->counter >= 100_000 ) c->done = true;
+	return !c->done;
+}
+
+bool logicB( global_t * mutex a, global_t * mutex b ) {
+	return logicC(a, b, &globalC);
+}
+
+bool logicA( global_t * mutex a ) {
+	return logicB(a, &globalB);
+}
+
+void main( Threads* this ) {
+	while( logicA(&globalA) ) { yield(); };
+}
+
+int main(int argc, char* argv[]) {
+	rand48seed(0);
+	processor p;
+	{
+		Threads t[17];
+	}
+}
Index: src/tests/sched-int-disjoint.c
===================================================================
--- src/tests/sched-int-disjoint.c	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
+++ src/tests/sched-int-disjoint.c	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -0,0 +1,115 @@
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <thread>
+
+#define N 100_000
+
+enum state_t { WAIT, SIGNAL, BARGE };
+
+monitor global_t {};
+global_t mut;
+
+monitor global_data_t;
+void ?{}( global_data_t * this );
+void ^?{} ( global_data_t * this );
+
+monitor global_data_t {
+	int counter;
+	state_t state;
+} data;
+
+condition cond;
+
+volatile bool all_done;
+
+void ?{}( global_data_t * this ) {
+	this->counter == 0;
+	this->state = BARGE;
+}
+
+void ^?{} ( global_data_t * this ) {}
+
+//------------------------------------------------------------------------------
+// Barging logic
+void barge( global_data_t * mutex d ) {
+	d->state = BARGE;
+}
+
+thread Barger {};
+
+void main( Barger * this ) {
+	while( !all_done ) { 
+		barge( &data );
+		yield(); 
+	}
+}
+
+//------------------------------------------------------------------------------
+// Waiting logic
+bool wait( global_t * mutex m, global_data_t * mutex d ) {
+	wait( &cond );
+	if( d->state != SIGNAL ) {
+		sout | "ERROR barging!" | endl; 
+	}
+
+	d->counter++;
+
+	if( (d->counter % 1000) == 0 ) sout | d->counter | endl;
+
+	return d->counter < N;
+}
+
+thread Waiter {};
+
+void main( Waiter * this ) {
+	while( wait( &mut, &data ) ) { yield(); }
+}
+
+
+//------------------------------------------------------------------------------
+// Signalling logic
+void signal( condition * cond, global_t * mutex a, global_data_t * mutex b ) {
+	b->state = SIGNAL;
+	signal( cond );
+}
+
+void logic( global_t * mutex a ) {
+	signal( &cond, a, &data );
+
+	int pauses = (unsigned)rand48() % 10;
+	for(int i = 0; i < pauses; i++) {
+		yield();
+	}
+
+	//This is technically a mutual exclusion violation but the mutex monitor protects us
+	bool running = data.counter < N && data.counter > 0;
+	if( data.state != SIGNAL && running ) {
+		sout | "ERROR Eager signal" | data.state | endl; 
+	}
+}
+
+thread Signaller {};
+
+void main( Signaller * this ) {
+	while( !all_done ) { 
+		logic( &mut );
+		yield(); 
+	}
+}
+
+//------------------------------------------------------------------------------
+// Main loop
+int main(int argc, char* argv[]) {
+	all_done = false;
+	processor p;
+	{
+		Signaller s;
+		Barger b[17];
+		{
+			Waiter w[4];
+		}
+		sout | "All waiter done" | endl;
+		all_done = true;
+	}	
+}
Index: src/tests/sched-int-multi.c
===================================================================
--- src/tests/sched-int-multi.c	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <stdlib>
-#include <thread>
-
-enum state_t { WAIT, SIGNAL, BARGE };
-
-monitor global_t {};
-
-monitor global_data_t {
-	bool done;
-	int counter;
-	state_t state;
-
-	unsigned short do_signal;
-	unsigned short do_wait2;
-	unsigned short do_wait1;
-};
-
-void ?{} ( global_data_t * this ) {
-	this->done = false;
-	this->counter = 0;
-	this->state = BARGE;
-
-	this->do_signal = 6;
-	this->do_wait1  = 1;
-	this->do_wait2  = 3;
-}
-
-void ^?{} ( global_data_t * this ) {}
-
-global_t globalA;
-global_t globalB;
-global_data_t globalC;
-
-condition cond;
-
-thread Threads {};
-
-bool logicC( global_t * mutex a, global_t * mutex b, global_data_t * mutex c ) {
-	c->counter++;
-
-	if( (c->counter % 1000) == 0 ) sout | c->counter | endl;
-
-	int action = c->counter % 10;
-
-	if( action == 0 ) {
-		c->do_signal = max( ((unsigned)rand48()) % 10, 1);
-		c->do_wait1 = ((unsigned)rand48()) % (c->do_signal);
-		c->do_wait2 = ((unsigned)rand48()) % (c->do_signal);
-
-		// if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
-	}
-
-	if( action == c->do_wait1 || action == c->do_wait2 ) {
-		c->state = WAIT;
-		wait( &cond );
-
-		if(c->state != SIGNAL) {
-			sout | "ERROR Barging detected" | c->counter | endl;
-			abort();
-		}
-	}
-	else if( action == c->do_signal ) {
-		c->state = SIGNAL;
-
-		signal( &cond );
-		signal( &cond );
-	}
-	else {
-		c->state = BARGE;
-	}
-
-	if( c->counter >= 100_000 ) c->done = true;
-	return !c->done;
-}
-
-bool logicB( global_t * mutex a, global_t * mutex b ) {
-	return logicC(a, b, &globalC);
-}
-
-bool logicA( global_t * mutex a ) {
-	return logicB(a, &globalB);
-}
-
-void main( Threads* this ) {
-	while( logicA(&globalA) ) { yield(); };
-}
-
-int main(int argc, char* argv[]) {
-	rand48seed(0);
-	processor p;
-	{
-		Threads t[17];
-	}
-}
Index: src/tests/sched-int-multi2.c
===================================================================
--- src/tests/sched-int-multi2.c	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ 	(revision )
@@ -1,145 +1,0 @@
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <stdlib>
-#include <thread>
-
-monitor global_t {};
-
-global_t globalA;
-global_t globalB;
-global_t globalC;
-
-condition condAB, condAC, condBC, condABC;
-
-thread Signaler {
-	int signals[4];
-};
-
-void ?{}( Signaler * this ){
-	this->signals[0] = 0;
-	this->signals[1] = 0;
-	this->signals[2] = 0;
-	this->signals[3] = 0;
-}
-
-thread WaiterAB {};
-thread WaiterAC {};
-thread WaiterBC {};
-thread WaiterABC{};
-
-volatile bool done;
-
-//----------------------------------------------------------------------------------------------------
-// Tools
-void signal( condition * cond, global_t * mutex a, global_t * mutex b ) {
-	signal( cond );
-}
-
-void signal( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) {
-	signal( cond );
-}
-
-void wait( condition * cond, global_t * mutex a, global_t * mutex b ) {
-	wait( cond );
-}
-
-void wait( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) {
-	wait( cond );
-}
-
-//----------------------------------------------------------------------------------------------------
-// Signaler
-void main( Signaler* this ) {
-
-	while( true ) {
-		int action = (unsigned)rand48() % 4;
-		bool finished = true;
-
-		for(int i = 0; i < 4; i++) {
-			if( this->signals[action] < 10_000 ) {
-				finished = false;
-				break;
-			}
-			else {
-				action = (action + 1) % 4;
-			}
-		}
-
-		this->signals[action]++;
-		if( finished ) break;
-
-		//sout | action | this->signals[0] | this->signals[1] | this->signals[2] | this->signals[3] | endl;
-
-		switch( action ) {
-			case 0: 
-				signal( &condABC, &globalA, &globalB, &globalC );
-				break;
-			case 1: 
-				signal( &condAB , &globalA, &globalB );
-				break;
-			case 2: 
-				signal( &condBC , &globalB, &globalC );
-				break;
-			case 3: 
-				signal( &condAC , &globalA, &globalC );
-				break;
-			default:
-				sout | "Something went wrong" | endl;
-				abort();
-		}
-	}	
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter ABC
-void main( WaiterABC* this ) {
-	while( !done ) {
-		wait( &condABC, &globalA, &globalB, &globalC );
-	}
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter AB
-void main( WaiterAB* this ) {
-	while( !done ) {
-		wait( &condAB , &globalA, &globalB );
-	}
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter AC
-void main( WaiterAC* this ) {
-	while( !done ) {
-		wait( &condAC , &globalA, &globalC );
-	}
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter BC
-void main( WaiterBC* this ) {
-	while( !done ) {
-		wait( &condBC , &globalB, &globalC );
-	}
-}
-
-//----------------------------------------------------------------------------------------------------
-// Main
-int main(int argc, char* argv[]) {
-	done = false;
-	processor p;
-	{
-		WaiterABC a;
-		WaiterAB  b;
-		WaiterBC  c;
-		WaiterAC  d;
-		{
-			Signaler  e;
-		}
-		done = true;
-		signal( &condABC, &globalA, &globalB, &globalC );
-		signal( &condAB , &globalA, &globalB );
-		signal( &condBC , &globalB, &globalC );
-		signal( &condAC , &globalA, &globalC );
-	}
-}
Index: src/tests/sched-int-wait.c
===================================================================
--- src/tests/sched-int-wait.c	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
+++ src/tests/sched-int-wait.c	(revision 9737ffeba379a793d918a4f50f36c0869f7e64ff)
@@ -0,0 +1,145 @@
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <stdlib>
+#include <thread>
+
+monitor global_t {};
+
+global_t globalA;
+global_t globalB;
+global_t globalC;
+
+condition condAB, condAC, condBC, condABC;
+
+thread Signaler {
+	int signals[4];
+};
+
+void ?{}( Signaler * this ){
+	this->signals[0] = 0;
+	this->signals[1] = 0;
+	this->signals[2] = 0;
+	this->signals[3] = 0;
+}
+
+thread WaiterAB {};
+thread WaiterAC {};
+thread WaiterBC {};
+thread WaiterABC{};
+
+volatile bool done;
+
+//----------------------------------------------------------------------------------------------------
+// Tools
+void signal( condition * cond, global_t * mutex a, global_t * mutex b ) {
+	signal( cond );
+}
+
+void signal( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) {
+	signal( cond );
+}
+
+void wait( condition * cond, global_t * mutex a, global_t * mutex b ) {
+	wait( cond );
+}
+
+void wait( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) {
+	wait( cond );
+}
+
+//----------------------------------------------------------------------------------------------------
+// Signaler
+void main( Signaler* this ) {
+
+	while( true ) {
+		int action = (unsigned)rand48() % 4;
+		bool finished = true;
+
+		for(int i = 0; i < 4; i++) {
+			if( this->signals[action] < 10_000 ) {
+				finished = false;
+				break;
+			}
+			else {
+				action = (action + 1) % 4;
+			}
+		}
+
+		this->signals[action]++;
+		if( finished ) break;
+
+		//sout | action | this->signals[0] | this->signals[1] | this->signals[2] | this->signals[3] | endl;
+
+		switch( action ) {
+			case 0: 
+				signal( &condABC, &globalA, &globalB, &globalC );
+				break;
+			case 1: 
+				signal( &condAB , &globalA, &globalB );
+				break;
+			case 2: 
+				signal( &condBC , &globalB, &globalC );
+				break;
+			case 3: 
+				signal( &condAC , &globalA, &globalC );
+				break;
+			default:
+				sout | "Something went wrong" | endl;
+				abort();
+		}
+	}	
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter ABC
+void main( WaiterABC* this ) {
+	while( !done ) {
+		wait( &condABC, &globalA, &globalB, &globalC );
+	}
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter AB
+void main( WaiterAB* this ) {
+	while( !done ) {
+		wait( &condAB , &globalA, &globalB );
+	}
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter AC
+void main( WaiterAC* this ) {
+	while( !done ) {
+		wait( &condAC , &globalA, &globalC );
+	}
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter BC
+void main( WaiterBC* this ) {
+	while( !done ) {
+		wait( &condBC , &globalB, &globalC );
+	}
+}
+
+//----------------------------------------------------------------------------------------------------
+// Main
+int main(int argc, char* argv[]) {
+	done = false;
+	processor p;
+	{
+		WaiterABC a;
+		WaiterAB  b;
+		WaiterBC  c;
+		WaiterAC  d;
+		{
+			Signaler  e;
+		}
+		done = true;
+		signal( &condABC, &globalA, &globalB, &globalC );
+		signal( &condAB , &globalA, &globalB );
+		signal( &condBC , &globalB, &globalC );
+		signal( &condAC , &globalA, &globalC );
+	}
+}
Index: src/tests/sched-int.c
===================================================================
--- src/tests/sched-int.c	(revision 102a58b77bb744015a557bbe3dbad51e39e3965f)
+++ 	(revision )
@@ -1,115 +1,0 @@
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <thread>
-
-#define N 100_000
-
-enum state_t { WAIT, SIGNAL, BARGE };
-
-monitor global_t {};
-global_t mut;
-
-monitor global_data_t;
-void ?{}( global_data_t * this );
-void ^?{} ( global_data_t * this );
-
-monitor global_data_t {
-	int counter;
-	state_t state;
-} data;
-
-condition cond;
-
-volatile bool all_done;
-
-void ?{}( global_data_t * this ) {
-	this->counter == 0;
-	this->state = BARGE;
-}
-
-void ^?{} ( global_data_t * this ) {}
-
-//------------------------------------------------------------------------------
-// Barging logic
-void barge( global_data_t * mutex d ) {
-	d->state = BARGE;
-}
-
-thread Barger {};
-
-void main( Barger * this ) {
-	while( !all_done ) { 
-		barge( &data );
-		yield(); 
-	}
-}
-
-//------------------------------------------------------------------------------
-// Waiting logic
-bool wait( global_t * mutex m, global_data_t * mutex d ) {
-	wait( &cond );
-	if( d->state != SIGNAL ) {
-		sout | "ERROR barging!" | endl; 
-	}
-
-	d->counter++;
-
-	if( (d->counter % 1000) == 0 ) sout | d->counter | endl;
-
-	return d->counter < N;
-}
-
-thread Waiter {};
-
-void main( Waiter * this ) {
-	while( wait( &mut, &data ) ) { yield(); }
-}
-
-
-//------------------------------------------------------------------------------
-// Signalling logic
-void signal( condition * cond, global_t * mutex a, global_data_t * mutex b ) {
-	b->state = SIGNAL;
-	signal( cond );
-}
-
-void logic( global_t * mutex a ) {
-	signal( &cond, a, &data );
-
-	int pauses = (unsigned)rand48() % 10;
-	for(int i = 0; i < pauses; i++) {
-		yield();
-	}
-
-	//This is technically a mutual exclusion violation but the mutex monitor protects us
-	bool running = data.counter < N && data.counter > 0;
-	if( data.state != SIGNAL && running ) {
-		sout | "ERROR Eager signal" | data.state | endl; 
-	}
-}
-
-thread Signaller {};
-
-void main( Signaller * this ) {
-	while( !all_done ) { 
-		logic( &mut );
-		yield(); 
-	}
-}
-
-//------------------------------------------------------------------------------
-// Main loop
-int main(int argc, char* argv[]) {
-	all_done = false;
-	processor p;
-	{
-		Signaller s;
-		Barger b[17];
-		{
-			Waiter w[4];
-		}
-		sout | "All waiter done" | endl;
-		all_done = true;
-	}	
-}
