Index: src/tests/coroutine.c
===================================================================
--- src/tests/coroutine.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/coroutine.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -25,26 +25,26 @@
 }
 
-void main( Fibonacci * this ) {
+void main( Fibonacci & this ) {
 	int fn1, fn2;					// retained between resumes
-	this->fn = 0;					// case 0
-	fn1 = this->fn;
+	this.fn = 0;					// case 0
+	fn1 = this.fn;
 	suspend();						// return to last resume
 
-	this->fn = 1;					// case 1
+	this.fn = 1;					// case 1
 	fn2 = fn1;
-	fn1 = this->fn;
+	fn1 = this.fn;
 	suspend();						// return to last resume
 
 	for ( ;; ) {					// general case
-		this->fn = fn1 + fn2;
+		this.fn = fn1 + fn2;
 		fn2 = fn1;
-		fn1 = this->fn;
+		fn1 = this.fn;
 		suspend();					// return to last resume
 	} // for
 }
 
-int next( Fibonacci * this ) {
+int next( Fibonacci & this ) {
 	resume( this );					// transfer to last suspend
-	return this->fn;
+	return this.fn;
 }
 
@@ -52,5 +52,5 @@
 	Fibonacci f1, f2;
 	for ( int i = 1; i <= 10; i += 1 ) {
-		sout | next( &f1 ) | ' ' | next( &f2 ) | endl;
+		sout | next( f1 ) | ' ' | next( f2 ) | endl;
 	} // for
 }
Index: src/tests/monitor.c
===================================================================
--- src/tests/monitor.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/monitor.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -14,13 +14,13 @@
 static global_t global;
 
-void increment3( global_t * mutex this ) {
-	this->value += 1;
+void increment3( global_t & mutex this ) {
+	this.value += 1;
 }
 
-void increment2( global_t * mutex this ) {
+void increment2( global_t & mutex this ) {
 	increment3( this );
 }
 
-void increment( global_t * mutex this ) {
+void increment( global_t & mutex this ) {
 	increment2( this );
 }
@@ -28,7 +28,7 @@
 thread MyThread {};
 
-void main( MyThread* this ) {
+void main( MyThread & this ) {
 	for(int i = 0; i < 1_000_000; i++) {
-		increment( &global );
+		increment( global );
 	}
 }
Index: src/tests/multi-monitor.c
===================================================================
--- src/tests/multi-monitor.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/multi-monitor.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -10,14 +10,11 @@
 static monitor_t m1, m2, m3;
 
-void increment( monitor_t * mutex p1, monitor_t * mutex p2, int * value ) {
-	*value += 1;
+void increment( monitor_t & mutex p1, monitor_t & mutex p2, int & value ) {
+	value += 1;
 }
 
-struct MyThread {
-	thread_desc __thrd;
+thread MyThread {
 	int target;
 };
-
-DECL_THREAD(MyThread);
 
 void ?{}( MyThread & this, int target ) {
@@ -27,12 +24,18 @@
 void ^?{}( MyThread & mutex this ) {}
 
-void main( MyThread* this ) {
+void main( MyThread & this ) {
 	for(int i = 0; i < 1000000; i++) {
-		choose(this->target) {
-			case 0: increment( &m1, &m2, &global12 );
-			case 1: increment( &m2, &m3, &global23 );
-			case 2: increment( &m1, &m3, &global13 );
+		choose(this.target) {
+			case 0: increment( m1, m2, global12 );
+			case 1: increment( m2, m3, global23 );
+			case 2: increment( m1, m3, global13 );
 		}
 	}
+}
+
+forall(dtype T | sized(T) | { void ^?{}(T & mutex); })
+void delete_mutex(T * x) {
+	^(*x){};
+	free(x);
 }
 
@@ -40,11 +43,11 @@
 	processor p;
 	{
-		scoped(MyThread) * f[6];
+		MyThread * f[6];
 		for(int i = 0; i < 6; i++) {
-			f[i] = (*(scoped(MyThread) *)malloc()){ i % 3 };
+			f[i] = new(i % 3);
 		}
 
 		for(int i = 0; i < 6; i++) {
-			delete( f[i] );
+			delete_mutex( f[i] );
 		}
 	}
Index: src/tests/preempt.c
===================================================================
--- src/tests/preempt.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/preempt.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -20,7 +20,7 @@
 }
 
-void main(worker_t * this) {
+void main(worker_t & this) {
 	while(counter < 1000) {
-		if( (counter % 7) == this->value ) {
+		if( (counter % 7) == this.value ) {
 			int next = __atomic_add_fetch_4(&counter, 1, __ATOMIC_SEQ_CST);
 			if( (next % 100) == 0 ) printf("%d\n", next);
Index: src/tests/sched-int-barge.c
===================================================================
--- src/tests/sched-int-barge.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/sched-int-barge.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -39,30 +39,30 @@
 thread Threads {};
 
-bool logicC( global_t * mutex a, global_t * mutex b, global_data_t * mutex c ) {
-	c->counter++;
+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;
+	if( (c.counter % 1000) == 0 ) sout | c.counter | endl;
 
-	int action = c->counter % 10;
+	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);
+		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(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
 	}
 
-	if( action == c->do_wait1 || action == c->do_wait2 ) {
-		c->state = WAIT;
+	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;
+		if(c.state != SIGNAL) {
+			sout | "ERROR Barging detected" | c.counter | endl;
 			abort();
 		}
 	}
-	else if( action == c->do_signal ) {
-		c->state = SIGNAL;
+	else if( action == c.do_signal ) {
+		c.state = SIGNAL;
 
 		signal( &cond );
@@ -70,21 +70,21 @@
 	}
 	else {
-		c->state = BARGE;
+		c.state = BARGE;
 	}
 
-	if( c->counter >= 100_000 ) c->done = true;
-	return !c->done;
+	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 logicB( global_t & mutex a, global_t & mutex b ) {
+	return logicC(a, b, globalC);
 }
 
-bool logicA( global_t * mutex a ) {
-	return logicB(a, &globalB);
+bool logicA( global_t & mutex a ) {
+	return logicB(a, globalB);
 }
 
-void main( Threads* this ) {
-	while( logicA(&globalA) ) { yield(); };
+void main( Threads & this ) {
+	while( logicA(globalA) ) { yield(); };
 }
 
Index: src/tests/sched-int-block.c
===================================================================
--- src/tests/sched-int-block.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/sched-int-block.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -30,15 +30,15 @@
 
 //------------------------------------------------------------------------------
-void wait_op( global_data_t * mutex a, global_data_t * mutex b, unsigned i ) {
+void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
 	wait( &cond, (uintptr_t)this_thread );
 
 	yield( ((unsigned)rand48()) % 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;
+	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;
+	a.last_thread = b.last_thread = this_thread;
 
 	yield( ((unsigned)rand48()) % 10 );
@@ -46,15 +46,15 @@
 
 thread Waiter {};
-void main( Waiter* this ) {
+void main( Waiter & this ) {
 	for( int i = 0; i < N; i++ ) {
-		wait_op( &globalA, &globalB, i );
+		wait_op( globalA, globalB, i );
 	}
 }
 
 //------------------------------------------------------------------------------
-void signal_op( global_data_t * mutex a, global_data_t * mutex b ) {
+void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
 	yield( ((unsigned)rand48()) % 10 );
 
-	a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread;
+	[a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
 
 	if( !is_empty( &cond ) ) {
@@ -69,6 +69,6 @@
 		yield( ((unsigned)rand48()) % 10 );
 
-		if(a->last_thread != next || b->last_thread != next) {
-			sout | "ERROR Barging detected, expected" | next | "got" | a->last_thread | b->last_thread | endl;
+		if(a.last_thread != next || b.last_thread != next) {
+			sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread | endl;
 			abort();
 		}
@@ -78,21 +78,22 @@
 
 thread Signaller {};
-void main( Signaller* this ) {
+void main( Signaller & this ) {
 	while( !done ) {
-		signal_op( &globalA, &globalB );
+		signal_op( globalA, globalB );
 	}
 }
 
 //------------------------------------------------------------------------------
-void barge_op( global_data_t * mutex a ) {
-	a->last_thread = this_thread;
+void barge_op( global_data_t & mutex a ) {
+	a.last_thread = this_thread;
 }
 
 thread Barger {};
-void main( Barger* this ) {
+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);
-		barge_op( choose_a ? &globalA : &globalB );
+		if ( choose_a ) barge_op( globalA );
+		else barge_op( globalB );
 	}
 }
Index: src/tests/sched-int-disjoint.c
===================================================================
--- src/tests/sched-int-disjoint.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/sched-int-disjoint.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -35,13 +35,13 @@
 //------------------------------------------------------------------------------
 // Barging logic
-void barge( global_data_t * mutex d ) {
-	d->state = BARGE;
+void barge( global_data_t & mutex d ) {
+	d.state = BARGE;
 }
 
 thread Barger {};
 
-void main( Barger * this ) {
+void main( Barger & this ) {
 	while( !all_done ) {
-		barge( &data );
+		barge( data );
 		yield();
 	}
@@ -50,21 +50,21 @@
 //------------------------------------------------------------------------------
 // Waiting logic
-bool wait( global_t * mutex m, global_data_t * mutex d ) {
+bool wait( global_t & mutex m, global_data_t & mutex d ) {
 	wait( &cond );
-	if( d->state != SIGNAL ) {
+	if( d.state != SIGNAL ) {
 		sout | "ERROR barging!" | endl;
 	}
 
-	d->counter++;
+	d.counter++;
 
-	if( (d->counter % 1000) == 0 ) sout | d->counter | endl;
+	if( (d.counter % 1000) == 0 ) sout | d.counter | endl;
 
-	return d->counter < N;
+	return d.counter < N;
 }
 
 thread Waiter {};
 
-void main( Waiter * this ) {
-	while( wait( &mut, &data ) ) { yield(); }
+void main( Waiter & this ) {
+	while( wait( mut, data ) ) { yield(); }
 }
 
@@ -72,11 +72,11 @@
 //------------------------------------------------------------------------------
 // Signalling logic
-void signal( condition * cond, global_t * mutex a, global_data_t * mutex b ) {
-	b->state = SIGNAL;
+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 );
+void logic( global_t & mutex a ) {
+	signal( &cond, a, data );
 
 	yield( (unsigned)rand48() % 10 );
@@ -91,7 +91,7 @@
 thread Signaller {};
 
-void main( Signaller * this ) {
+void main( Signaller & this ) {
 	while( !all_done ) {
-		logic( &mut );
+		logic( mut );
 		yield();
 	}
Index: src/tests/sched-int-wait.c
===================================================================
--- src/tests/sched-int-wait.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/sched-int-wait.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -27,17 +27,17 @@
 //----------------------------------------------------------------------------------------------------
 // Tools
-void signal( condition * cond, global_t * mutex a, global_t * mutex b ) {
+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 ) {
+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 ) {
+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 ) {
+void wait( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
 	wait( cond );
 }
@@ -45,5 +45,5 @@
 //----------------------------------------------------------------------------------------------------
 // Signaler
-void main( Signaler* this ) {
+void main( Signaler & this ) {
 
 	while( waiter_left != 0 ) {
@@ -51,14 +51,14 @@
 		switch( action ) {
 			case 0:
-				signal( &condABC, &globalA, &globalB, &globalC );
+				signal( &condABC, globalA, globalB, globalC );
 				break;
 			case 1:
-				signal( &condAB , &globalA, &globalB );
+				signal( &condAB , globalA, globalB );
 				break;
 			case 2:
-				signal( &condBC , &globalB, &globalC );
+				signal( &condBC , globalB, globalC );
 				break;
 			case 3:
-				signal( &condAC , &globalA, &globalC );
+				signal( &condAC , globalA, globalC );
 				break;
 			default:
@@ -72,7 +72,7 @@
 //----------------------------------------------------------------------------------------------------
 // Waiter ABC
-void main( WaiterABC* this ) {
+void main( WaiterABC & this ) {
 	for( int i = 0; i < N; i++ ) {
-		wait( &condABC, &globalA, &globalB, &globalC );
+		wait( &condABC, globalA, globalB, globalC );
 	}
 
@@ -82,7 +82,7 @@
 //----------------------------------------------------------------------------------------------------
 // Waiter AB
-void main( WaiterAB* this ) {
+void main( WaiterAB & this ) {
 	for( int i = 0; i < N; i++ ) {
-		wait( &condAB , &globalA, &globalB );
+		wait( &condAB , globalA, globalB );
 	}
 
@@ -92,7 +92,7 @@
 //----------------------------------------------------------------------------------------------------
 // Waiter AC
-void main( WaiterAC* this ) {
+void main( WaiterAC & this ) {
 	for( int i = 0; i < N; i++ ) {
-		wait( &condAC , &globalA, &globalC );
+		wait( &condAC , globalA, globalC );
 	}
 
@@ -102,7 +102,7 @@
 //----------------------------------------------------------------------------------------------------
 // Waiter BC
-void main( WaiterBC* this ) {
+void main( WaiterBC & this ) {
 	for( int i = 0; i < N; i++ ) {
-		wait( &condBC , &globalB, &globalC );
+		wait( &condBC , globalB, globalC );
 	}
 
Index: src/tests/thread.c
===================================================================
--- src/tests/thread.c	(revision e25707d90aed2290b64dad39620f375dd24f0997)
+++ src/tests/thread.c	(revision 83a071f98d287fe0dd150376b0c6ea5ff812b18b)
@@ -7,17 +7,17 @@
 thread Second { semaphore* lock; };
 
-void ?{}( First & this, semaphore* lock ) { this.lock = lock; }
-void ?{}( Second & this, semaphore* lock ) { this.lock = lock; }
+void ?{}( First & this, semaphore & lock ) { this.lock = &lock; }
+void ?{}( Second & this, semaphore & lock ) { this.lock = &lock; }
 
-void main(First* this) {
+void main(First& this) {
 	for(int i = 0; i < 10; i++) {
 		sout | "First : Suspend No." | i + 1 | endl;
 		yield();
 	}
-	V(this->lock);
+	V(this.lock);
 }
 
-void main(Second* this) {
-	P(this->lock);
+void main(Second& this) {
+	P(this.lock);
 	for(int i = 0; i < 10; i++) {
 		sout | "Second : Suspend No." | i + 1 | endl;
@@ -33,6 +33,6 @@
 		processor p;
 		{
-			First  f = { &lock };
-			Second s = { &lock };
+			First  f = { lock };
+			Second s = { lock };
 		}
 	}
