Index: src/tests/concurrent/examples/.expect/boundedBuffer.txt
===================================================================
--- src/tests/concurrent/examples/.expect/boundedBuffer.txt	(revision 8ad653339f39e704e4be3cbd354de857c44a52f4)
+++ 	(revision )
@@ -1,1 +1,0 @@
-total:500000
Index: src/tests/concurrent/examples/.expect/boundedBufferEXT.txt
===================================================================
--- src/tests/concurrent/examples/.expect/boundedBufferEXT.txt	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
+++ src/tests/concurrent/examples/.expect/boundedBufferEXT.txt	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
@@ -0,0 +1,79 @@
+concurrent/examples/boundedBufferEXT.c:39:1 error: No alternatives for function in call to waitfor
+/u/pabuhr/software/cfa-cc/include/cfa/bits/containers.h:170:1 error: candidate function not viable: no mutex parameters
+forall
+  _6573_20_T: sized object type
+  ... with assertions
+    get_next: pointer to function
+    ... with parameters
+      reference to instance of type _6573_20_T (not function type) 
+    ... returning 
+      _retval_get_next: reference to pointer to instance of type _6573_20_T (not function type) 
+      ... with attributes: 
+        Attribute with name: unused
+
+
+
+  lvalue function
+... with parameters
+  this: reference to instance of struct __queue with body 1 
+  ... with parameters
+    instance of type _6573_20_T (not function type) 
+
+  it: pointer to pointer to instance of type _6573_20_T (not function type) 
+... returning 
+  _retval_remove: pointer to instance of type _6573_20_T (not function type) 
+  ... with attributes: 
+    Attribute with name: unused
+
+
+/usr/include/stdio.h:178:1 error: candidate function not viable: no mutex parameters
+lvalue function
+... with parameters
+  __filename: C pointer to const char
+... returning 
+  _retval_remove: signed int
+  ... with attributes: 
+    Attribute with name: unused
+
+
+concurrent/examples/boundedBufferEXT.c:47:1 error: No alternatives for function in call to waitfor
+concurrent/examples/boundedBufferEXT.c:37:1 error: candidate function not viable: too few mutex arguments
+forall
+  _6578_20_T: sized object type
+  ... with assertions
+    ?=?: pointer to function
+    ... with parameters
+      reference to instance of type _6578_20_T (not function type) 
+      instance of type _6578_20_T (not function type) 
+    ... returning 
+      _retval__operator_assign: instance of type _6578_20_T (not function type) 
+      ... with attributes: 
+        Attribute with name: unused
+
+
+    ?{}: pointer to function
+    ... with parameters
+      reference to instance of type _6578_20_T (not function type) 
+    ... returning nothing 
+
+    ?{}: pointer to function
+    ... with parameters
+      reference to instance of type _6578_20_T (not function type) 
+      instance of type _6578_20_T (not function type) 
+    ... returning nothing 
+
+    ^?{}: pointer to function
+    ... with parameters
+      reference to instance of type _6578_20_T (not function type) 
+    ... returning nothing 
+
+
+  lvalue function
+... with parameters
+  buffer: mutex reference to instance of struct Buffer with body 1 
+  ... with parameters
+    instance of type _6578_20_T (not function type) 
+
+  elem: instance of type _6578_20_T (not function type) 
+... returning nothing 
+
Index: src/tests/concurrent/examples/.expect/boundedBufferINT.txt
===================================================================
--- src/tests/concurrent/examples/.expect/boundedBufferINT.txt	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
+++ src/tests/concurrent/examples/.expect/boundedBufferINT.txt	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
@@ -0,0 +1,1 @@
+total:400000
Index: src/tests/concurrent/examples/boundedBuffer.c
===================================================================
--- src/tests/concurrent/examples/boundedBuffer.c	(revision 8ad653339f39e704e4be3cbd354de857c44a52f4)
+++ 	(revision )
@@ -1,120 +1,0 @@
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// boundedBuffer.c --
-//
-// Author           : Peter A. Buhr
-// Created On       : Mon Oct 30 12:45:13 2017
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jan  2 12:18:18 2018
-// Update Count     : 33
-//
-
-#include <stdlib>
-#include <fstream>										// random
-#include <kernel>
-#include <thread>
-#include <unistd.h>										// getpid
-
-monitor Buffer {
-	condition full, empty;
-	int front, back, count;
-	int elements[20];
-};
-
-void ?{}( Buffer & buffer ) {
-	buffer.front = buffer.back = buffer.count = 0;
-}
-
-int query( Buffer & buffer ) { return buffer.count; }
-
-void insert( Buffer & mutex buffer, int elem ) with( buffer ) {
-	if ( count == 20 ) wait( empty );
-	elements[back] = elem;
-	back = ( back + 1 ) % 20;
-	count += 1;
-	signal( full );
-}
-
-int remove( Buffer & mutex buffer ) with( buffer ) {
-	if ( count == 0 ) wait( full );
-	int elem = elements[front];
-	front = ( front + 1 ) % 20;
-	count -= 1;
-	signal( empty );
-	return elem;
-}
-
-thread Producer {
-	Buffer & buffer;
-	unsigned int N;
-};
-void main( Producer & prod ) {
-	for ( int i = 1; i <= prod.N; i += 1 ) {
-		yield( random( 5 ) );
-		insert( prod.buffer, 1 );
-	} // for
-	insert( prod.buffer, -1 );
-}
-void ?{}( Producer & prod, Buffer * buffer, unsigned int N ) {
-	&prod.buffer = buffer;
-	prod.N = N;
-}
-
-thread Consumer {
-	Buffer & buffer;
-	int & sum;						// summation of producer values
-};
-void main( Consumer & cons ) {
-	cons.sum = 0;
-	for ( ;; ) {
-		yield( random( 5 ) );
-		int item = remove( cons.buffer );
-		if ( item == -1 ) break;				// sentinel ?
-		cons.sum += item;
-	} // for
-}
-void ?{}( Consumer & cons, Buffer * buffer, int * sum ) {
-	&cons.buffer = buffer;
-	&cons.sum = sum;
-}
-
-int main() {
-	Buffer buffer;
-	enum { Prods = 5, Cons = 5 };
-	Producer * prods[Prods];
-	Consumer * cons[Cons];
-	const int Sentinel = -1;
-	int sums[Cons];
-	int i;
-	processor p;
-
-	//srandom( getpid() );
-	srandom( 1003 );
-
-	for ( i = 0; i < Cons; i += 1 ) {			// create consumers
-		cons[i] = new( &buffer, &sums[i] );
-	} // for
-	for ( i = 0; i < Prods; i += 1 ) {			// create producers
-		prods[i] = new( &buffer, 100000u );
-	} // for
-
-	for ( i = 0; i < Prods; i += 1 ) {			// wait for producers to finish
-		delete( prods[i] );
-	} // for
-	for ( i = 0; i < Cons; i += 1 ) {			// generate sentinal values to stop consumers
-		insert( buffer, Sentinel );
-	} // for
-	int sum = 0;
-	for ( i = 0; i < Cons; i += 1 ) {			// wait for consumers to finish
-		delete( cons[i] );
-		sum += sums[i];
-	} // for
-	sout | "total:" | sum | endl;
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa boundedBuffer.c" //
-// End: //
Index: src/tests/concurrent/examples/boundedBufferEXT.c
===================================================================
--- src/tests/concurrent/examples/boundedBufferEXT.c	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
+++ src/tests/concurrent/examples/boundedBufferEXT.c	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
@@ -0,0 +1,124 @@
+// 
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// boundedBufferEXT.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Apr 18 22:52:12 2018
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Apr 18 22:56:17 2018
+// Update Count     : 2
+// 
+
+#include <stdlib>										// random
+#include <fstream>
+#include <kernel>
+#include <thread>
+#include <unistd.h>										// getpid
+
+//Duration default_preemption() { return 0; }
+
+enum { BufferSize = 5 };
+
+forall( otype T )
+monitor Buffer {
+	int front, back, count;
+	T elements[BufferSize];
+};
+
+forall( otype T )
+void ?{}( Buffer(T) & buffer ) with( buffer ) { [front, back, count] = 0; }
+
+forall( otype T )
+int query( Buffer(T) & buffer ) { return buffer.count; }
+
+forall( otype T )
+void insert( Buffer(T) & mutex buffer, T elem ) with( buffer ) {
+	if ( count == BufferSize ) waitfor( remove );
+	elements[back] = elem;
+	back = ( back + 1 ) % BufferSize;
+	count += 1;
+}
+
+forall( otype T )
+T remove( Buffer(T) & mutex buffer ) with( buffer ) {
+	if ( count == 0 ) waitfor( insert );
+	T elem = elements[front];
+	front = ( front + 1 ) % BufferSize;
+	count -= 1;
+	return elem;
+}
+
+const int Sentinel = -1;
+
+thread Producer {
+	Buffer(int) & buffer;
+	unsigned int N;
+};
+void main( Producer & prod ) with( prod ) {
+	for ( int i = 1; i <= N; i += 1 ) {
+		yield( random( 5 ) );
+		insert( buffer, 1 );
+	} // for
+}
+void ?{}( Producer & prod, Buffer(int) * buffer, int N ) {
+	&prod.buffer = buffer;
+	prod.N = N;
+}
+
+thread Consumer {
+	Buffer(int) & buffer;
+	int & sum;											// summation of producer values
+};
+void main( Consumer & cons ) with( cons ) {
+	sum = 0;
+	for ( ;; ) {
+		yield( random( 5 ) );
+		int item = remove( buffer );
+	  if ( item == Sentinel ) break;					// sentinel ?
+		sum += item;
+	} // for
+}
+void ?{}( Consumer & cons, Buffer(int) * buffer, int & sum ) {
+	&cons.buffer = buffer;
+	&cons.sum = &sum;
+}
+
+int main() {
+	Buffer(int) buffer;
+	enum { Prods = 4, Cons = 5 };
+	Producer * prods[Prods];
+	Consumer * cons[Cons];
+	int sums[Cons];
+	int i;
+	processor p;
+
+	//srandom( getpid() );
+	srandom( 1003 );
+
+	for ( i = 0; i < Cons; i += 1 ) {					// create consumers
+		cons[i] = new( &buffer, sums[i] );
+	} // for
+	for ( i = 0; i < Prods; i += 1 ) {					// create producers
+		prods[i] = new( &buffer, 100000 );
+	} // for
+
+	for ( i = 0; i < Prods; i += 1 ) {					// wait for producers to finish
+		delete( prods[i] );
+	} // for
+	for ( i = 0; i < Cons; i += 1 ) {					// generate sentinal values to stop consumers
+		insert( buffer, Sentinel );
+	} // for
+	int sum = 0;
+	for ( i = 0; i < Cons; i += 1 ) {					// wait for consumers to finish
+		delete( cons[i] );
+		sum += sums[i];
+	} // for
+	sout | "total:" | sum | endl;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa boundedBufferEXT.c" //
+// End: //
Index: src/tests/concurrent/examples/boundedBufferINT.c
===================================================================
--- src/tests/concurrent/examples/boundedBufferINT.c	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
+++ src/tests/concurrent/examples/boundedBufferINT.c	(revision 88f15ae7977cd21fe85f845fd0a70397546352f8)
@@ -0,0 +1,120 @@
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// boundedBuffer.c --
+//
+// Author           : Peter A. Buhr
+// Created On       : Mon Oct 30 12:45:13 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Jan  2 12:18:18 2018
+// Update Count     : 33
+//
+
+#include <stdlib>
+#include <fstream>										// random
+#include <kernel>
+#include <thread>
+#include <unistd.h>										// getpid
+
+monitor Buffer {
+	condition full, empty;
+	int front, back, count;
+	int elements[20];
+};
+
+void ?{}( Buffer & buffer ) {
+	buffer.front = buffer.back = buffer.count = 0;
+}
+
+int query( Buffer & buffer ) { return buffer.count; }
+
+void insert( Buffer & mutex buffer, int elem ) with( buffer ) {
+	if ( count == 20 ) wait( empty );
+	elements[back] = elem;
+	back = ( back + 1 ) % 20;
+	count += 1;
+	signal( full );
+}
+
+int remove( Buffer & mutex buffer ) with( buffer ) {
+	if ( count == 0 ) wait( full );
+	int elem = elements[front];
+	front = ( front + 1 ) % 20;
+	count -= 1;
+	signal( empty );
+	return elem;
+}
+
+thread Producer {
+	Buffer & buffer;
+	unsigned int N;
+};
+void main( Producer & prod ) {
+	for ( int i = 1; i <= prod.N; i += 1 ) {
+		yield( random( 5 ) );
+		insert( prod.buffer, 1 );
+	} // for
+	insert( prod.buffer, -1 );
+}
+void ?{}( Producer & prod, Buffer * buffer, unsigned int N ) {
+	&prod.buffer = buffer;
+	prod.N = N;
+}
+
+thread Consumer {
+	Buffer & buffer;
+	int & sum;						// summation of producer values
+};
+void main( Consumer & cons ) {
+	cons.sum = 0;
+	for ( ;; ) {
+		yield( random( 5 ) );
+		int item = remove( cons.buffer );
+		if ( item == -1 ) break;				// sentinel ?
+		cons.sum += item;
+	} // for
+}
+void ?{}( Consumer & cons, Buffer * buffer, int * sum ) {
+	&cons.buffer = buffer;
+	&cons.sum = sum;
+}
+
+int main() {
+	Buffer buffer;
+	enum { Prods = 5, Cons = 5 };
+	Producer * prods[Prods];
+	Consumer * cons[Cons];
+	const int Sentinel = -1;
+	int sums[Cons];
+	int i;
+	processor p;
+
+	//srandom( getpid() );
+	srandom( 1003 );
+
+	for ( i = 0; i < Cons; i += 1 ) {			// create consumers
+		cons[i] = new( &buffer, &sums[i] );
+	} // for
+	for ( i = 0; i < Prods; i += 1 ) {			// create producers
+		prods[i] = new( &buffer, 100000u );
+	} // for
+
+	for ( i = 0; i < Prods; i += 1 ) {			// wait for producers to finish
+		delete( prods[i] );
+	} // for
+	for ( i = 0; i < Cons; i += 1 ) {			// generate sentinal values to stop consumers
+		insert( buffer, Sentinel );
+	} // for
+	int sum = 0;
+	for ( i = 0; i < Cons; i += 1 ) {			// wait for consumers to finish
+		delete( cons[i] );
+		sum += sums[i];
+	} // for
+	sout | "total:" | sum | endl;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa boundedBuffer.c" //
+// End: //
