Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/InitTweak/GenInit.cc	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -332,5 +332,6 @@
 			if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) {
 				if ( isManaged( field ) ) {
-					managedTypes.insert( SymTab::Mangler::mangle( aggregateDecl ) );
+					StructInstType inst( Type::Qualifiers(), aggregateDecl );
+					managedTypes.insert( SymTab::Mangler::mangle( &inst ) );
 					break;
 				}
Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/Parser/DeclarationNode.cc	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 12:34:05 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 13:06:50 2017
-// Update Count     : 753
+// Last Modified On : Thu Feb 23 15:45:02 2017
+// Update Count     : 759
 //
 
@@ -174,8 +174,4 @@
 	} // if
 
-	if ( body ) {
-		newnode->type->function.hasBody = true;
-	} // if
-
 	if ( ret ) {
 		newnode->type->base = ret->type;
@@ -259,5 +255,5 @@
 } // DeclarationNode::newAggregate
 
-DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) {
+DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants, bool body ) {
 	DeclarationNode * newnode = new DeclarationNode;
 	newnode->type = new TypeData( TypeData::Enum );
@@ -268,4 +264,5 @@
 	} // if
 	newnode->type->enumeration.constants = constants;
+	newnode->type->enumeration.body = body;
 	return newnode;
 } // DeclarationNode::newEnum
@@ -698,5 +695,4 @@
 	assert( ! type->function.body );
 	type->function.body = body;
-	type->function.hasBody = true;
 	return this;
 }
@@ -1040,24 +1036,45 @@
 	switch ( type->kind ) {
 	  case TypeData::Enum: {
-		  EnumDecl * typedecl = buildEnum( type, attributes );
-		  return new EnumInstType( buildQualifiers( type ), typedecl );
+		  if ( type->enumeration.body ) {
+			  EnumDecl * typedecl = buildEnum( type, attributes );
+			  return new EnumInstType( buildQualifiers( type ), typedecl );
+		  } else {
+			  return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
+		  }
 	  }
 	  case TypeData::Aggregate: {
-		  AggregateDecl * typedecl = buildAggregate( type, attributes );
 		  ReferenceToType * ret;
-		  switch ( type->aggregate.kind ) {
-			case DeclarationNode::Struct:
-			  ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
-			  break;
-			case DeclarationNode::Union:
-			  ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
-			  break;
-			case DeclarationNode::Trait:
-			  assert( false );
-			  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
-			  break;
-			default:
-			  assert( false );
-		  } // switch
+		  if ( type->aggregate.body ) {
+			  AggregateDecl * typedecl = buildAggregate( type, attributes );
+			  switch ( type->aggregate.kind ) {
+				case DeclarationNode::Struct:
+				  ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
+				  break;
+				case DeclarationNode::Union:
+				  ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
+				  break;
+				case DeclarationNode::Trait:
+				  assert( false );
+				  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
+				  break;
+				default:
+				  assert( false );
+			  } // switch
+		  } else {
+			  switch ( type->aggregate.kind ) {
+				case DeclarationNode::Struct:
+				  ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
+				  break;
+				case DeclarationNode::Union:
+				  ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
+				  break;
+				case DeclarationNode::Trait:
+				  assert( false );
+				  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
+				  break;
+				default:
+				  assert( false );
+			  } // switch
+		  } // if
 		  buildList( type->aggregate.actuals, ret->get_parameters() );
 		  return ret;
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/Parser/ParseNode.h	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 13:15:55 2017
-// Update Count     : 661
+// Last Modified On : Thu Feb 23 15:22:10 2017
+// Update Count     : 662
 //
 
@@ -238,5 +238,5 @@
 	static DeclarationNode * newFromTypedef( std::string * );
 	static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
-	static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants );
+	static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );
 	static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );
 	static DeclarationNode * newName( std::string * );
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/Parser/TypeData.cc	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:12:51 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Feb 19 09:49:33 2017
-// Update Count     : 467
+// Last Modified On : Thu Feb 23 16:26:39 2017
+// Update Count     : 477
 //
 
@@ -48,5 +48,4 @@
 		function.oldDeclList = nullptr;
 		function.body = nullptr;
-		function.hasBody = false;
 		function.newStyle = false;
 		break;
@@ -68,4 +67,5 @@
 		enumeration.name = nullptr;
 		enumeration.constants = nullptr;
+		enumeration.body = false;
 		break;
 	  case Symbolic:
@@ -182,5 +182,4 @@
 		newtype->function.oldDeclList = maybeClone( function.oldDeclList );
 		newtype->function.body = maybeClone( function.body );
-		newtype->function.hasBody = function.hasBody;
 		newtype->function.newStyle = function.newStyle;
 		break;
@@ -200,4 +199,5 @@
 		newtype->enumeration.name = enumeration.name ? new string( *enumeration.name ) : nullptr;
 		newtype->enumeration.constants = maybeClone( enumeration.constants );
+		newtype->enumeration.body = enumeration.body;
 		break;
 	  case Symbolic:
@@ -293,8 +293,6 @@
 		} // if
 		os << endl;
-		if ( function.hasBody ) {
+		if ( function.body ) {
 			os << string( indent + 2, ' ' ) << "with body " << endl;
-		} // if
-		if ( function.body ) {
 			function.body->printList( os, indent + 2 );
 		} // if
@@ -335,4 +333,7 @@
 			os << "with constants" << endl;
 			enumeration.constants->printList( os, indent + 2 );
+		} // if
+		if ( enumeration.body ) {
+			os << string( indent + 2, ' ' ) << " with body " << endl;
 		} // if
 		break;
@@ -696,4 +697,5 @@
 		} // if
 	} // for
+	ret->set_body( td->enumeration.body );
 	return ret;
 } // buildEnum
@@ -724,22 +726,12 @@
 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, ConstantExpr *asmName, Initializer * init, std::list< Attribute * > attributes ) {
 	if ( td->kind == TypeData::Function ) {
-		if ( td->function.idList ) {
-			buildKRFunction( td->function );
+		if ( td->function.idList ) {					// KR function ?
+			buildKRFunction( td->function );			// transform into C11 function
 		} // if
 
 		FunctionDecl * decl;
-		if ( td->function.hasBody ) {
-			if ( td->function.body ) {
-				Statement * stmt = td->function.body->build();
-				CompoundStmt * body = dynamic_cast< CompoundStmt* >( stmt );
-				assert( body );
-				decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn, attributes );
-			} else {
-				// list< Label > ls;
-				decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( list< Label >() ), isInline, isNoreturn, attributes );
-			} // if
-		} else {
-			decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), nullptr, isInline, isNoreturn, attributes );
-		} // if
+		Statement * stmt = maybeBuild<Statement>( td->function.body );
+		CompoundStmt * body = dynamic_cast< CompoundStmt* >( stmt );
+		decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn, attributes );
 		return decl->set_asmName( asmName );
 	} else if ( td->kind == TypeData::Aggregate ) {
@@ -816,5 +808,5 @@
 
 	for ( DeclarationNode * param = function.idList; param != nullptr; param = dynamic_cast< DeclarationNode* >( param->get_next() ) ) {
-		if ( ! param->type ) {							// generate type int for empty parameters
+		if ( ! param->type ) {							// generate type int for empty parameter type
 			param->type = new TypeData( TypeData::Basic );
 			param->type->basictype = DeclarationNode::Int;
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/Parser/TypeData.h	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:18:36 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 14:30:05 2017
-// Update Count     : 153
+// Last Modified On : Thu Feb 23 15:16:18 2017
+// Update Count     : 155
 //
 
@@ -49,4 +49,5 @@
 		const std::string * name;
 		DeclarationNode * constants;
+		bool body;
 	};
 
@@ -56,5 +57,4 @@
 		mutable DeclarationNode * oldDeclList;
 		StatementNode * body;
-		bool hasBody;
 		bool newStyle;
 	};
Index: src/Parser/parser.cc
===================================================================
--- src/Parser/parser.cc	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/Parser/parser.cc	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -7292,5 +7292,5 @@
 /* Line 1806 of yacc.c  */
 #line 1651 "parser.yy"
-    { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(4) - (6)].decl) )->addQualifiers( (yyvsp[(2) - (6)].decl) ); }
+    { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(4) - (6)].decl), true )->addQualifiers( (yyvsp[(2) - (6)].decl) ); }
     break;
 
@@ -7301,5 +7301,5 @@
     {
 			typedefTable.makeTypedef( *(yyvsp[(3) - (3)].tok) );
-			(yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (3)].tok), 0 )->addQualifiers( (yyvsp[(2) - (3)].decl) );
+			(yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (3)].tok), 0, false )->addQualifiers( (yyvsp[(2) - (3)].decl) );
 		}
     break;
@@ -7316,5 +7316,5 @@
 /* Line 1806 of yacc.c  */
 #line 1660 "parser.yy"
-    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (8)].tok), (yyvsp[(6) - (8)].decl) )->addQualifiers( (yyvsp[(2) - (8)].decl) ); }
+    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (8)].tok), (yyvsp[(6) - (8)].decl), true )->addQualifiers( (yyvsp[(2) - (8)].decl) ); }
     break;
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/Parser/parser.yy	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 15:56:33 2017
-// Update Count     : 2186
+// Last Modified On : Thu Feb 23 15:23:49 2017
+// Update Count     : 2187
 //
 
@@ -1649,14 +1649,14 @@
 enum_type:
 	ENUM attribute_list_opt '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( nullptr, $4 )->addQualifiers( $2 ); }
+		{ $$ = DeclarationNode::newEnum( nullptr, $4, true )->addQualifiers( $2 ); }
 	| ENUM attribute_list_opt no_attr_identifier_or_type_name
 		{
 			typedefTable.makeTypedef( *$3 );
-			$$ = DeclarationNode::newEnum( $3, 0 )->addQualifiers( $2 );
+			$$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 );
 		}
 	| ENUM attribute_list_opt no_attr_identifier_or_type_name
 		{ typedefTable.makeTypedef( *$3 ); }
 	  '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( $3, $6 )->addQualifiers( $2 ); }
+		{ $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); }
 	;
 
Index: src/benchmark/Makefile.am
===================================================================
--- src/benchmark/Makefile.am	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/benchmark/Makefile.am	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -24,5 +24,5 @@
 bench :
 	@for ccflags in "-debug" "-nodebug"; do \
-		echo ${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt bench.c;\
+		echo ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -lrt bench.c;\
 		${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt bench.c;\
 		./a.out ; \
@@ -31,5 +31,5 @@
 
 ctxswitch-coroutine:
-	${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -nodebug -lrt -DN=10000000 CorCtxSwitch.c
+	${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=10000000 CorCtxSwitch.c
 	@for number in 1 2 3 4 5 6 7 8 9 10; do \
                 ./a.out ; \
@@ -38,5 +38,5 @@
 
 ctxswitch-thread:
-	${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -nodebug -lrt -DN=10000000 ThrdCtxSwitch.c
+	${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=10000000 ThrdCtxSwitch.c
 	@for number in 1 2 3 4 5 6 7 8 9 10; do \
                 ./a.out ; \
@@ -45,5 +45,5 @@
 
 csv-data:
-	@${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -nodebug -lrt -quiet -DN=10000000 csv-data.c
+	@${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=10000000 csv-data.c
 	@./a.out
 	@rm -f ./a.out
Index: src/benchmark/Makefile.in
===================================================================
--- src/benchmark/Makefile.in	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/benchmark/Makefile.in	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -471,5 +471,5 @@
 bench :
 	@for ccflags in "-debug" "-nodebug"; do \
-		echo ${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt bench.c;\
+		echo ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -lrt bench.c;\
 		${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt bench.c;\
 		./a.out ; \
@@ -478,5 +478,5 @@
 
 ctxswitch-coroutine:
-	${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -nodebug -lrt -DN=10000000 CorCtxSwitch.c
+	${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=10000000 CorCtxSwitch.c
 	@for number in 1 2 3 4 5 6 7 8 9 10; do \
                 ./a.out ; \
@@ -485,5 +485,5 @@
 
 ctxswitch-thread:
-	${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -nodebug -lrt -DN=10000000 ThrdCtxSwitch.c
+	${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=10000000 ThrdCtxSwitch.c
 	@for number in 1 2 3 4 5 6 7 8 9 10; do \
                 ./a.out ; \
@@ -492,5 +492,5 @@
 
 csv-data:
-	@${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -nodebug -lrt -quiet -DN=10000000 csv-data.c
+	@${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=10000000 csv-data.c
 	@./a.out
 	@rm -f ./a.out
Index: src/benchmark/csv-data.c
===================================================================
--- src/benchmark/csv-data.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/benchmark/csv-data.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -3,7 +3,9 @@
 #include <threads>
 
+extern "C" {
 #include <unistd.h>					// sysconf
 #include <sys/times.h>					// times
 #include <time.h>
+}
 
 inline unsigned long long int Time() {
@@ -84,4 +86,4 @@
 int main()
 {
-	sout | time(NULL) | "," | measure_coroutine() | "," | measure_thread() | endl;
+	sout | time(NULL) | ',' | measure_coroutine() | ',' | measure_thread() | endl;
 }
Index: src/examples/multicore.c
===================================================================
--- src/examples/multicore.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/examples/multicore.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -19,8 +19,5 @@
 		processor p;
 		{
-			scoped(MyThread) f1;
-			scoped(MyThread) f2;
-			scoped(MyThread) f3;
-			scoped(MyThread) f4;
+			scoped(MyThread) f[4];
 		}
 	}
Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/Makefile.am	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -44,5 +44,5 @@
 # not all platforms support concurrency, add option do disable it
 if BUILD_CONCURRENCY
-headers += containers/vector concurrency/coroutines concurrency/threads concurrency/kernel
+headers += containers/vector concurrency/coroutines concurrency/threads concurrency/kernel concurrency/monitor
 endif
 
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/Makefile.in	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -43,5 +43,5 @@
 
 # not all platforms support concurrency, add option do disable it
-@BUILD_CONCURRENCY_TRUE@am__append_3 = containers/vector concurrency/coroutines concurrency/threads concurrency/kernel
+@BUILD_CONCURRENCY_TRUE@am__append_3 = containers/vector concurrency/coroutines concurrency/threads concurrency/kernel concurrency/monitor
 
 # not all platforms support concurrency, add option do disable it
@@ -101,10 +101,12 @@
 	containers/vector.c concurrency/coroutines.c \
 	concurrency/threads.c concurrency/kernel.c \
-	concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/invoke.c
+	concurrency/monitor.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
+	concurrency/invoke.c
 am__dirstamp = $(am__leading_dot)dirstamp
 @BUILD_CONCURRENCY_TRUE@am__objects_1 = containers/libcfa_d_a-vector.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-coroutines.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-threads.$(OBJEXT) \
-@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-kernel.$(OBJEXT)
+@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-kernel.$(OBJEXT) \
+@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-monitor.$(OBJEXT)
 am__objects_2 = libcfa_d_a-limits.$(OBJEXT) \
 	libcfa_d_a-stdlib.$(OBJEXT) libcfa_d_a-math.$(OBJEXT) \
@@ -124,10 +126,12 @@
 	containers/vector.c concurrency/coroutines.c \
 	concurrency/threads.c concurrency/kernel.c \
-	concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/invoke.c
+	concurrency/monitor.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
+	concurrency/invoke.c
 @BUILD_CONCURRENCY_TRUE@am__objects_5 =  \
 @BUILD_CONCURRENCY_TRUE@	containers/libcfa_a-vector.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-coroutines.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-threads.$(OBJEXT) \
-@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-kernel.$(OBJEXT)
+@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-kernel.$(OBJEXT) \
+@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-monitor.$(OBJEXT)
 am__objects_6 = libcfa_a-limits.$(OBJEXT) libcfa_a-stdlib.$(OBJEXT) \
 	libcfa_a-math.$(OBJEXT) libcfa_a-iostream.$(OBJEXT) \
@@ -172,5 +176,6 @@
 	fstream iterator rational assert containers/vector \
 	concurrency/coroutines concurrency/threads concurrency/kernel \
-	${shell echo stdhdr/*} concurrency/invoke.h
+	concurrency/monitor ${shell echo stdhdr/*} \
+	concurrency/invoke.h
 HEADERS = $(nobase_cfa_include_HEADERS)
 ETAGS = etags
@@ -398,4 +403,6 @@
 concurrency/libcfa_d_a-kernel.$(OBJEXT): concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
+concurrency/libcfa_d_a-monitor.$(OBJEXT): concurrency/$(am__dirstamp) \
+	concurrency/$(DEPDIR)/$(am__dirstamp)
 concurrency/CtxSwitch-@MACHINE_TYPE@.$(OBJEXT):  \
 	concurrency/$(am__dirstamp) \
@@ -416,4 +423,6 @@
 concurrency/libcfa_a-kernel.$(OBJEXT): concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
+concurrency/libcfa_a-monitor.$(OBJEXT): concurrency/$(am__dirstamp) \
+	concurrency/$(DEPDIR)/$(am__dirstamp)
 concurrency/libcfa_a-invoke.$(OBJEXT): concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
@@ -429,8 +438,10 @@
 	-rm -f concurrency/libcfa_a-invoke.$(OBJEXT)
 	-rm -f concurrency/libcfa_a-kernel.$(OBJEXT)
+	-rm -f concurrency/libcfa_a-monitor.$(OBJEXT)
 	-rm -f concurrency/libcfa_a-threads.$(OBJEXT)
 	-rm -f concurrency/libcfa_d_a-coroutines.$(OBJEXT)
 	-rm -f concurrency/libcfa_d_a-invoke.$(OBJEXT)
 	-rm -f concurrency/libcfa_d_a-kernel.$(OBJEXT)
+	-rm -f concurrency/libcfa_d_a-monitor.$(OBJEXT)
 	-rm -f concurrency/libcfa_d_a-threads.$(OBJEXT)
 	-rm -f containers/libcfa_a-vector.$(OBJEXT)
@@ -462,8 +473,10 @@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-invoke.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-kernel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-monitor.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-threads.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-invoke.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-kernel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-monitor.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-threads.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_a-vector.Po@am__quote@
@@ -677,4 +690,18 @@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-kernel.obj `if test -f 'concurrency/kernel.c'; then $(CYGPATH_W) 'concurrency/kernel.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/kernel.c'; fi`
 
+concurrency/libcfa_d_a-monitor.o: concurrency/monitor.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-monitor.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-monitor.Tpo -c -o concurrency/libcfa_d_a-monitor.o `test -f 'concurrency/monitor.c' || echo '$(srcdir)/'`concurrency/monitor.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-monitor.Tpo concurrency/$(DEPDIR)/libcfa_d_a-monitor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/monitor.c' object='concurrency/libcfa_d_a-monitor.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-monitor.o `test -f 'concurrency/monitor.c' || echo '$(srcdir)/'`concurrency/monitor.c
+
+concurrency/libcfa_d_a-monitor.obj: concurrency/monitor.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-monitor.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-monitor.Tpo -c -o concurrency/libcfa_d_a-monitor.obj `if test -f 'concurrency/monitor.c'; then $(CYGPATH_W) 'concurrency/monitor.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/monitor.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-monitor.Tpo concurrency/$(DEPDIR)/libcfa_d_a-monitor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/monitor.c' object='concurrency/libcfa_d_a-monitor.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-monitor.obj `if test -f 'concurrency/monitor.c'; then $(CYGPATH_W) 'concurrency/monitor.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/monitor.c'; fi`
+
 concurrency/libcfa_d_a-invoke.obj: concurrency/invoke.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-invoke.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-invoke.Tpo -c -o concurrency/libcfa_d_a-invoke.obj `if test -f 'concurrency/invoke.c'; then $(CYGPATH_W) 'concurrency/invoke.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/invoke.c'; fi`
@@ -858,4 +885,18 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-kernel.obj `if test -f 'concurrency/kernel.c'; then $(CYGPATH_W) 'concurrency/kernel.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/kernel.c'; fi`
+
+concurrency/libcfa_a-monitor.o: concurrency/monitor.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-monitor.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-monitor.Tpo -c -o concurrency/libcfa_a-monitor.o `test -f 'concurrency/monitor.c' || echo '$(srcdir)/'`concurrency/monitor.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-monitor.Tpo concurrency/$(DEPDIR)/libcfa_a-monitor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/monitor.c' object='concurrency/libcfa_a-monitor.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-monitor.o `test -f 'concurrency/monitor.c' || echo '$(srcdir)/'`concurrency/monitor.c
+
+concurrency/libcfa_a-monitor.obj: concurrency/monitor.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-monitor.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-monitor.Tpo -c -o concurrency/libcfa_a-monitor.obj `if test -f 'concurrency/monitor.c'; then $(CYGPATH_W) 'concurrency/monitor.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/monitor.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-monitor.Tpo concurrency/$(DEPDIR)/libcfa_a-monitor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/monitor.c' object='concurrency/libcfa_a-monitor.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-monitor.obj `if test -f 'concurrency/monitor.c'; then $(CYGPATH_W) 'concurrency/monitor.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/monitor.c'; fi`
 
 concurrency/libcfa_a-invoke.obj: concurrency/invoke.c
Index: src/libcfa/concurrency/kernel.c
===================================================================
--- src/libcfa/concurrency/kernel.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/concurrency/kernel.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -456,5 +456,5 @@
 
 void append( simple_thread_list * this, thread * t ) {
-	assert( t->next == NULL );
+	assert(this->tail != NULL);
 	*this->tail = t;
 	this->tail = &t->next;
@@ -470,5 +470,4 @@
 		head->next = NULL;
 	}	
-	
 	return head;
 }
Index: src/libcfa/concurrency/monitor
===================================================================
--- src/libcfa/concurrency/monitor	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
+++ src/libcfa/concurrency/monitor	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -0,0 +1,45 @@
+//                              -*- Mode: CFA -*-
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// monitor --
+//
+// Author           : Thierry Delisle
+// Created On       : Thd Feb 23 12:27:26 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#ifndef MONITOR_H
+#define MONITOR_H
+
+#include "assert"
+#include "invoke.h"
+
+struct monitor {
+	spinlock lock;
+	thread * holder;
+	simple_thread_list entry_queue;
+};
+
+void enter(monitor *);
+void leave(monitor *);
+
+struct monitor_guard {
+	monitor * m;
+};
+
+static inline void ?{}( monitor_guard * this, monitor * m ) {
+	this->m = m;
+	enter( this->m );
+}
+
+static inline void ^?{}( monitor_guard * this ) {
+	leave( this->m );
+}
+
+#endif //MONITOR_H
Index: src/libcfa/concurrency/monitor.c
===================================================================
--- src/libcfa/concurrency/monitor.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
+++ src/libcfa/concurrency/monitor.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -0,0 +1,48 @@
+//                              -*- Mode: CFA -*-
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// monitor.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Thd Feb 23 12:27:26 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#include "monitor"
+
+#include "kernel_private.h"
+
+void enter(monitor * this) {
+	lock( &this->lock );
+	thread * thrd = this_thread();
+
+	if( this->holder ) {
+		append( &this->entry_queue, thrd );
+		ScheduleInternal( &this->lock );
+		return;
+	}
+	else {
+		this->holder = thrd;
+	}
+
+	unlock( &this->lock );
+}
+
+void leave(monitor * this) {
+	lock( &this->lock );
+
+	thread * thrd = this_thread();
+	assert( thrd == this->holder );
+
+	this->holder = pop_head( &this->entry_queue );
+
+	unlock( &this->lock );
+
+	if( this->holder ) ScheduleThread( this->holder );
+}
Index: src/libcfa/concurrency/threads
===================================================================
--- src/libcfa/concurrency/threads	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/concurrency/threads	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -9,5 +9,5 @@
 //
 // Author           : Thierry Delisle
-// Created On       : Tue Jan 17 12:27:26 2016
+// Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Thierry Delisle
 // Last Modified On : --
Index: src/libcfa/concurrency/threads.c
===================================================================
--- src/libcfa/concurrency/threads.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/concurrency/threads.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -9,5 +9,5 @@
 //
 // Author           : Thierry Delisle
-// Created On       : Tue Jan 17 12:27:26 2016
+// Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Thierry Delisle
 // Last Modified On : --
Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/stdlib	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jul  6 14:28:55 2016
-// Update Count     : 99
+// Last Modified On : Thu Feb 23 14:11:47 2017
+// Update Count     : 100
 //
 
@@ -50,5 +50,5 @@
 forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );
 forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr );
-
+forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } ) void delete( T * ptr, Params rest );
 
 //---------------------------------------
Index: src/libcfa/stdlib.c
===================================================================
--- src/libcfa/stdlib.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/libcfa/stdlib.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jul  6 14:28:57 2016
-// Update Count     : 169
+// Last Modified On : Thu Feb 23 14:11:29 2017
+// Update Count     : 170
 //
 
@@ -91,4 +91,13 @@
 }
 
+forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } )
+void delete( T * ptr, Params rest ) {
+	if ( ptr ) {
+		^ptr{};
+		free( ptr );
+	}
+	delete( rest );
+}
+
 //---------------------------------------
 
Index: src/tests/.expect/abs.txt
===================================================================
--- src/tests/.expect/abs.txt	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/tests/.expect/abs.txt	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -1,3 +1,3 @@
-char			¿	abs A
+char			-65	abs 65
 signed int		-65	abs 65
 signed long int		-65	abs 65
Index: src/tests/.expect/globals.txt
===================================================================
--- src/tests/.expect/globals.txt	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
+++ src/tests/.expect/globals.txt	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -0,0 +1,9 @@
+static		inline		autogen		value
+no 		no 		no 		22
+no 		no 		yes		22
+no 		yes		no 		22
+no 		yes		yes		22
+yes		no 		no 		22
+yes		no 		yes		22
+yes		yes		no 		22
+yes		yes		yes		22
Index: src/tests/.expect/monitor.txt
===================================================================
--- src/tests/.expect/monitor.txt	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
+++ src/tests/.expect/monitor.txt	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -0,0 +1,1 @@
+4000000
Index: src/tests/abs.c
===================================================================
--- src/tests/abs.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/tests/abs.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 18:26:16 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar  2 15:07:26 2016
-// Update Count     : 51
+// Last Modified On : Wed Feb 22 22:31:03 2017
+// Update Count     : 52
 //
 
@@ -18,5 +18,5 @@
 
 int main( void ) {
-	char ch = -65;
+	signed char ch = -65;
 	sout | "char\t\t\t"					| ch     | "\tabs " | abs( ch ) | endl;
 	sout | "signed int\t\t"				| -65    | "\tabs" | abs( -65 ) | endl;
Index: src/tests/globals.c
===================================================================
--- src/tests/globals.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
+++ src/tests/globals.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -0,0 +1,83 @@
+#include <fstream>
+
+struct value_t {
+	int value;
+};
+
+void ?{}( value_t * this ) { this->value = 22; }
+
+//Standard case
+struct g_t {
+	value_t val;
+};
+
+void ?{}( g_t * this ) { (&this->val){}; }
+
+g_t g;
+
+//Autogen case
+struct ga_t {
+	value_t val;
+};
+
+ga_t ga;
+
+//Inline case
+struct gi_t;
+void ?{}( gi_t * this );
+
+struct gi_t {
+	value_t val;
+} gi;
+
+void ?{}( gi_t * this ) { (&this->val){}; }
+
+//Inline autogen case
+struct gia_t {
+	value_t val;
+} gia;
+
+//Static case
+struct gs_t {
+	value_t val;
+};
+
+void ?{}( gs_t * this ) { (&this->val){}; }
+
+static gs_t gs;
+
+//Static autogen case
+struct gsa_t {
+	value_t val;
+};
+
+static gsa_t gsa;
+
+//Static inline case
+struct gsi_t;
+void ?{}( gsi_t * this );
+
+static struct gsi_t {
+	value_t val;
+} gsi;
+
+void ?{}( gsi_t * this ) { (&this->val){}; }
+
+//Static inline autogen case
+static struct gsia_t {
+	value_t val;
+} gsia;
+
+int main() {
+	sout | "static\t\tinline\t\tautogen\t\tvalue" | endl;
+
+	sout | "no \t\tno \t\tno \t\t" | g.val.value    | endl;
+	sout | "no \t\tno \t\tyes\t\t" | ga.val.value   | endl;
+	sout | "no \t\tyes\t\tno \t\t" | gi.val.value   | endl;
+	sout | "no \t\tyes\t\tyes\t\t" | gia.val.value  | endl;
+	sout | "yes\t\tno \t\tno \t\t" | gs.val.value   | endl;
+	sout | "yes\t\tno \t\tyes\t\t" | gsa.val.value  | endl;
+	sout | "yes\t\tyes\t\tno \t\t" | gsi.val.value  | endl;
+	sout | "yes\t\tyes\t\tyes\t\t" | gsia.val.value | endl;
+
+}
Index: src/tests/monitor.c
===================================================================
--- src/tests/monitor.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
+++ src/tests/monitor.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -0,0 +1,41 @@
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <threads>
+
+struct global_t {
+	int value;
+	monitor m;
+};
+
+void ?{}(global_t * this) {
+	this->value = 0;
+}
+
+static global_t global;
+
+void increment( /*mutex*/ global_t * this ) {
+	monitor_guard g = { &this->m };
+	this->value += 1;
+}
+
+struct MyThread { thread t; };
+
+DECL_THREAD(MyThread);
+
+void ?{}( MyThread * this ) {}
+
+void main( MyThread* this ) {
+	for(int i = 0; i < 1000000; i++) {
+		increment( &global );
+	}
+}
+
+int main(int argc, char* argv[]) {
+	assert( global.m.entry_queue.tail != NULL );
+	processor p;
+	{
+		scoped(MyThread) f[4];
+	}
+	sout | global.value | endl;
+}
Index: src/tests/simpleGenericTriple.c
===================================================================
--- src/tests/simpleGenericTriple.c	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ src/tests/simpleGenericTriple.c	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -28,5 +28,5 @@
   int x1 = 123, x3 = 456;
   double x2 = 999.123;
-  struct T3(int) Li = { x1, x2, x3 };
+  struct T3(int) Li = { x1, (int)x2, x3 };
   struct T3(int) Ri = { 9, 2, 3 };
   struct T3(int) reti = Li+Ri;
