Index: src/tests/concurrent/signal/.expect/block.txt
===================================================================
--- src/tests/concurrent/signal/.expect/block.txt	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/.expect/block.txt	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,2 @@
+Starting waiters
+Waiters done
Index: src/tests/concurrent/signal/.expect/disjoint.txt
===================================================================
--- src/tests/concurrent/signal/.expect/disjoint.txt	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/.expect/disjoint.txt	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,11 @@
+1000
+2000
+3000
+4000
+5000
+6000
+7000
+8000
+9000
+10000
+All waiter done
Index: src/tests/concurrent/signal/.expect/wait.txt
===================================================================
--- src/tests/concurrent/signal/.expect/wait.txt	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/.expect/wait.txt	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,2 @@
+Starting
+Done
Index: src/tests/concurrent/signal/barge.c
===================================================================
--- src/tests/concurrent/signal/barge.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/barge.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,117 @@
+//----------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------
+//
+//		DEPRECATED TEST
+//
+//----------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------
+
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <stdlib>
+#include <thread>
+
+static const unsigned long N = 50_000ul;
+
+#ifndef PREEMPTION_RATE
+#define PREEMPTION_RATE 10_000ul
+#endif
+
+unsigned int default_preemption() {
+	return 0;
+}
+enum state_t { WAIT, SIGNAL, BARGE };
+
+monitor global_t {};
+
+monitor global_data_t {
+	volatile 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( random( 10 ), 1);
+		c.do_wait1 = random( c.do_signal );
+		c.do_wait2 = random( 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 >= N ) 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(); };
+}
+
+static thread_desc * volatile the_threads;
+
+int main(int argc, char* argv[]) {
+	random_seed(0);
+	processor p;
+	{
+		Threads t[17];
+		the_threads = (thread_desc*)t;
+	}
+}
Index: src/tests/concurrent/signal/block.c
===================================================================
--- src/tests/concurrent/signal/block.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/block.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,133 @@
+//---------------------------------------------------------
+// Barging test
+// Ensures that no barging can occur between :
+//   - the frontend of the signal_block and the signaled thread
+//   - the signaled  threadand the backend of the signal_block
+//---------------------------------------------------------
+
+
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <stdlib>
+#include <thread>
+
+#include <time.h>
+
+static const unsigned long N = 5_000ul;
+
+#ifndef PREEMPTION_RATE
+#define PREEMPTION_RATE 10_000ul
+#endif
+
+unsigned int default_preemption() {
+	return PREEMPTION_RATE;
+}
+
+enum state_t { WAITED, SIGNAL, BARGE };
+
+monitor global_data_t {
+	thread_desc * last_thread;
+	thread_desc * last_signaller;
+};
+
+void ?{} ( global_data_t & this ) {
+	this.last_thread = NULL;
+	this.last_signaller = NULL;
+}
+
+void ^?{} ( global_data_t & this ) {}
+
+global_data_t globalA, globalB;
+
+condition cond;
+
+volatile bool done;
+
+//------------------------------------------------------------------------------
+void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
+	wait( cond, (uintptr_t)this_thread );
+
+	yield( random( 10 ) );
+
+	if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
+		sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread | endl;
+		abort();
+	}
+
+	a.last_thread = b.last_thread = this_thread;
+
+	yield( random( 10 ) );
+}
+
+thread Waiter {};
+void main( Waiter & this ) {
+	for( int i = 0; i < N; i++ ) {
+		wait_op( globalA, globalB, i );
+	}
+}
+
+//------------------------------------------------------------------------------
+void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
+	yield( random( 10 ) );
+
+	[a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
+
+	if( !is_empty( cond ) ) {
+
+		thread_desc * next = front( cond );
+
+		if( ! signal_block( cond ) ) {
+			sout | "ERROR expected to be able to signal" | endl;
+			abort();
+		}
+
+		yield( random( 10 ) );
+
+		if(a.last_thread != next || b.last_thread != next) {
+			sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread | endl;
+			abort();
+		}
+	}
+
+}
+
+thread Signaller {};
+void main( Signaller & this ) {
+	while( !done ) {
+		signal_op( globalA, globalB );
+	}
+}
+
+//------------------------------------------------------------------------------
+void barge_op( global_data_t & mutex a ) {
+	a.last_thread = this_thread;
+}
+
+thread Barger {};
+void main( Barger & this ) {
+	for( unsigned i = 0; !done; i++ ) {
+		//Choose some monitor to barge into with some irregular pattern
+		bool choose_a = (i % 13) > (i % 17);
+		if ( choose_a ) barge_op( globalA );
+		else barge_op( globalB );
+	}
+}
+
+//------------------------------------------------------------------------------
+
+int main(int argc, char* argv[]) {
+	random_seed( time( NULL ) );
+	done = false;
+	processor p;
+	{
+		Signaller s[4];
+		Barger b[13];
+		sout | "Starting waiters" | endl;
+		{
+			Waiter w[3];
+		}
+		sout | "Waiters done" | endl;
+		done = true;
+	}
+}
Index: src/tests/concurrent/signal/disjoint.c
===================================================================
--- src/tests/concurrent/signal/disjoint.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/disjoint.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,123 @@
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <thread>
+
+#include <time.h>
+
+static const unsigned long N = 10_000ul;
+
+#ifndef PREEMPTION_RATE
+#define PREEMPTION_RATE 10_000ul
+#endif
+
+unsigned int default_preemption() {
+	return PREEMPTION_RATE;
+}
+
+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 );
+
+	yield( random( 10 ) );
+
+	//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[]) {
+	random_seed( time( NULL ) );
+	all_done = false;
+	processor p;
+	{
+		Signaller s;
+		Barger b[17];
+		{
+			Waiter w[4];
+		}
+		sout | "All waiter done" | endl;
+		all_done = true;
+	}
+}
Index: src/tests/concurrent/signal/sched-int-barge.c
===================================================================
--- src/tests/concurrent/signal/sched-int-barge.c	(revision 948887f54b841db71bcf45639198a43c534b76ef)
+++ 	(revision )
@@ -1,117 +1,0 @@
-//----------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------
-//
-//		DEPRECATED TEST
-//
-//----------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------
-
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <stdlib>
-#include <thread>
-
-static const unsigned long N = 50_000ul;
-
-#ifndef PREEMPTION_RATE
-#define PREEMPTION_RATE 10_000ul
-#endif
-
-unsigned int default_preemption() {
-	return 0;
-}
-enum state_t { WAIT, SIGNAL, BARGE };
-
-monitor global_t {};
-
-monitor global_data_t {
-	volatile 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( random( 10 ), 1);
-		c.do_wait1 = random( c.do_signal );
-		c.do_wait2 = random( 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 >= N ) 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(); };
-}
-
-static thread_desc * volatile the_threads;
-
-int main(int argc, char* argv[]) {
-	random_seed(0);
-	processor p;
-	{
-		Threads t[17];
-		the_threads = (thread_desc*)t;
-	}
-}
Index: src/tests/concurrent/signal/sched-int-block.c
===================================================================
--- src/tests/concurrent/signal/sched-int-block.c	(revision 948887f54b841db71bcf45639198a43c534b76ef)
+++ 	(revision )
@@ -1,133 +1,0 @@
-//---------------------------------------------------------
-// Barging test
-// Ensures that no barging can occur between :
-//   - the frontend of the signal_block and the signaled thread
-//   - the signaled  threadand the backend of the signal_block
-//---------------------------------------------------------
-
-
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <stdlib>
-#include <thread>
-
-#include <time.h>
-
-static const unsigned long N = 5_000ul;
-
-#ifndef PREEMPTION_RATE
-#define PREEMPTION_RATE 10_000ul
-#endif
-
-unsigned int default_preemption() {
-	return PREEMPTION_RATE;
-}
-
-enum state_t { WAITED, SIGNAL, BARGE };
-
-monitor global_data_t {
-	thread_desc * last_thread;
-	thread_desc * last_signaller;
-};
-
-void ?{} ( global_data_t & this ) {
-	this.last_thread = NULL;
-	this.last_signaller = NULL;
-}
-
-void ^?{} ( global_data_t & this ) {}
-
-global_data_t globalA, globalB;
-
-condition cond;
-
-volatile bool done;
-
-//------------------------------------------------------------------------------
-void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
-	wait( cond, (uintptr_t)this_thread );
-
-	yield( random( 10 ) );
-
-	if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
-		sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread | endl;
-		abort();
-	}
-
-	a.last_thread = b.last_thread = this_thread;
-
-	yield( random( 10 ) );
-}
-
-thread Waiter {};
-void main( Waiter & this ) {
-	for( int i = 0; i < N; i++ ) {
-		wait_op( globalA, globalB, i );
-	}
-}
-
-//------------------------------------------------------------------------------
-void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
-	yield( random( 10 ) );
-
-	[a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
-
-	if( !is_empty( cond ) ) {
-
-		thread_desc * next = front( cond );
-
-		if( ! signal_block( cond ) ) {
-			sout | "ERROR expected to be able to signal" | endl;
-			abort();
-		}
-
-		yield( random( 10 ) );
-
-		if(a.last_thread != next || b.last_thread != next) {
-			sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread | endl;
-			abort();
-		}
-	}
-
-}
-
-thread Signaller {};
-void main( Signaller & this ) {
-	while( !done ) {
-		signal_op( globalA, globalB );
-	}
-}
-
-//------------------------------------------------------------------------------
-void barge_op( global_data_t & mutex a ) {
-	a.last_thread = this_thread;
-}
-
-thread Barger {};
-void main( Barger & this ) {
-	for( unsigned i = 0; !done; i++ ) {
-		//Choose some monitor to barge into with some irregular pattern
-		bool choose_a = (i % 13) > (i % 17);
-		if ( choose_a ) barge_op( globalA );
-		else barge_op( globalB );
-	}
-}
-
-//------------------------------------------------------------------------------
-
-int main(int argc, char* argv[]) {
-	random_seed( time( NULL ) );
-	done = false;
-	processor p;
-	{
-		Signaller s[4];
-		Barger b[13];
-		sout | "Starting waiters" | endl;
-		{
-			Waiter w[3];
-		}
-		sout | "Waiters done" | endl;
-		done = true;
-	}
-}
Index: src/tests/concurrent/signal/sched-int-disjoint.c
===================================================================
--- src/tests/concurrent/signal/sched-int-disjoint.c	(revision 948887f54b841db71bcf45639198a43c534b76ef)
+++ 	(revision )
@@ -1,123 +1,0 @@
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <thread>
-
-#include <time.h>
-
-static const unsigned long N = 10_000ul;
-
-#ifndef PREEMPTION_RATE
-#define PREEMPTION_RATE 10_000ul
-#endif
-
-unsigned int default_preemption() {
-	return PREEMPTION_RATE;
-}
-
-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 );
-
-	yield( random( 10 ) );
-
-	//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[]) {
-	random_seed( time( NULL ) );
-	all_done = false;
-	processor p;
-	{
-		Signaller s;
-		Barger b[17];
-		{
-			Waiter w[4];
-		}
-		sout | "All waiter done" | endl;
-		all_done = true;
-	}
-}
Index: src/tests/concurrent/signal/sched-int-wait.c
===================================================================
--- src/tests/concurrent/signal/sched-int-wait.c	(revision 948887f54b841db71bcf45639198a43c534b76ef)
+++ 	(revision )
@@ -1,143 +1,0 @@
-//---------------------------------------------------------
-// Multi wait test
-// Ensures that no deadlock from waiting/signalling conditions
-//---------------------------------------------------------
-
-
-#include <fstream>
-#include <kernel>
-#include <monitor>
-#include <stdlib>
-#include <thread>
-
-#include <time.h>
-
-static const unsigned long N = 2_500ul;
-
-#ifndef PREEMPTION_RATE
-#define PREEMPTION_RATE 10_000ul
-#endif
-
-unsigned int default_preemption() {
-	return PREEMPTION_RATE;
-}
-
-monitor global_t {};
-
-global_t globalA;
-global_t globalB;
-global_t globalC;
-
-condition condAB, condAC, condBC, condABC;
-
-thread Signaler {};
-thread WaiterAB {};
-thread WaiterAC {};
-thread WaiterBC {};
-thread WaiterABC{};
-
-volatile int waiter_left;
-
-//----------------------------------------------------------------------------------------------------
-// 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( waiter_left != 0 ) {
-		unsigned action = random( 4 );
-		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();
-		}
-		yield();
-	}
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter ABC
-void main( WaiterABC & this ) {
-	for( int i = 0; i < N; i++ ) {
-		wait( condABC, globalA, globalB, globalC );
-	}
-
-	__sync_fetch_and_sub_4( &waiter_left, 1);
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter AB
-void main( WaiterAB & this ) {
-	for( int i = 0; i < N; i++ ) {
-		wait( condAB , globalA, globalB );
-	}
-
-	__sync_fetch_and_sub_4( &waiter_left, 1);
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter AC
-void main( WaiterAC & this ) {
-	for( int i = 0; i < N; i++ ) {
-		wait( condAC , globalA, globalC );
-	}
-
-	__sync_fetch_and_sub_4( &waiter_left, 1);
-}
-
-//----------------------------------------------------------------------------------------------------
-// Waiter BC
-void main( WaiterBC & this ) {
-	for( int i = 0; i < N; i++ ) {
-		wait( condBC , globalB, globalC );
-	}
-
-	__sync_fetch_and_sub_4( &waiter_left, 1);
-}
-
-//----------------------------------------------------------------------------------------------------
-// Main
-int main(int argc, char* argv[]) {
-	random_seed( time( NULL ) );
-	waiter_left = 4;
-	processor p[2];
-	sout | "Starting" | endl;
-	{
-		Signaler  e;
-		{
-			WaiterABC a;
-			WaiterAB  b;
-			WaiterBC  c;
-			WaiterAC  d;
-		}
-	}
-	sout | "Done" | endl;
-}
Index: src/tests/concurrent/signal/wait.c
===================================================================
--- src/tests/concurrent/signal/wait.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
+++ src/tests/concurrent/signal/wait.c	(revision b0e5593593d06c06d62641db360f3587561b97a6)
@@ -0,0 +1,143 @@
+//---------------------------------------------------------
+// Multi wait test
+// Ensures that no deadlock from waiting/signalling conditions
+//---------------------------------------------------------
+
+
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <stdlib>
+#include <thread>
+
+#include <time.h>
+
+static const unsigned long N = 2_500ul;
+
+#ifndef PREEMPTION_RATE
+#define PREEMPTION_RATE 10_000ul
+#endif
+
+unsigned int default_preemption() {
+	return PREEMPTION_RATE;
+}
+
+monitor global_t {};
+
+global_t globalA;
+global_t globalB;
+global_t globalC;
+
+condition condAB, condAC, condBC, condABC;
+
+thread Signaler {};
+thread WaiterAB {};
+thread WaiterAC {};
+thread WaiterBC {};
+thread WaiterABC{};
+
+volatile int waiter_left;
+
+//----------------------------------------------------------------------------------------------------
+// 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( waiter_left != 0 ) {
+		unsigned action = random( 4 );
+		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();
+		}
+		yield();
+	}
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter ABC
+void main( WaiterABC & this ) {
+	for( int i = 0; i < N; i++ ) {
+		wait( condABC, globalA, globalB, globalC );
+	}
+
+	__sync_fetch_and_sub_4( &waiter_left, 1);
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter AB
+void main( WaiterAB & this ) {
+	for( int i = 0; i < N; i++ ) {
+		wait( condAB , globalA, globalB );
+	}
+
+	__sync_fetch_and_sub_4( &waiter_left, 1);
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter AC
+void main( WaiterAC & this ) {
+	for( int i = 0; i < N; i++ ) {
+		wait( condAC , globalA, globalC );
+	}
+
+	__sync_fetch_and_sub_4( &waiter_left, 1);
+}
+
+//----------------------------------------------------------------------------------------------------
+// Waiter BC
+void main( WaiterBC & this ) {
+	for( int i = 0; i < N; i++ ) {
+		wait( condBC , globalB, globalC );
+	}
+
+	__sync_fetch_and_sub_4( &waiter_left, 1);
+}
+
+//----------------------------------------------------------------------------------------------------
+// Main
+int main(int argc, char* argv[]) {
+	random_seed( time( NULL ) );
+	waiter_left = 4;
+	processor p[2];
+	sout | "Starting" | endl;
+	{
+		Signaler  e;
+		{
+			WaiterABC a;
+			WaiterAB  b;
+			WaiterBC  c;
+			WaiterAC  d;
+		}
+	}
+	sout | "Done" | endl;
+}
