Index: Jenkins/FullBuild
===================================================================
--- Jenkins/FullBuild	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ Jenkins/FullBuild	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -1,17 +1,89 @@
 #!groovy
 
+//===========================================================================================================
+// Main loop of the compilation
+//===========================================================================================================
+
+node ('master') {
+	def err = null
+
+	try {
+		//Prevent the build from exceeding 30 minutes
+		timeout(60) {
+
+			//Wrap build to add timestamp to command line
+			wrap([$class: 'TimestamperBuildWrapper']) {
+
+				stage 'Build'
+
+					results = [null, null]
+
+					parallel (
+						gcc_6_x64: { trigger_build( 'gcc-6',   'x64' ) },
+						gcc_6_x86: { trigger_build( 'gcc-6',   'x86' ) },
+						gcc_5_x64: { trigger_build( 'gcc-5',   'x64' ) },
+						gcc_5_x86: { trigger_build( 'gcc-5',   'x86' ) },
+						gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64' ) },
+						gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86' ) },
+						clang_x64: { trigger_build( 'clang',   'x64' ) },
+						clang_x86: { trigger_build( 'clang',   'x86' ) },
+					)
+
+				//Push latest changes to do-lang repo
+				push_build()
+			}
+		}
+	}
+
+	//If an exception is caught we need to change the status and remember to
+	//attach the build log to the email
+	catch (Exception caughtError) {
+		echo('error caught')
+
+		//rethrow error later
+		err = caughtError
+
+		//Store the result of the build log
+		currentBuild.result = 'FAILURE'
+
+		//Send email to notify the failure
+		promote_failure_email()
+	}
+
+	finally {
+		//Must re-throw exception to propagate error
+		if (err) {
+			throw err
+		}
+	}
+}
 //===========================================================================================================
 // Main compilation routines
 //===========================================================================================================
 
-def trigger_build(String arch) {
+def trigger_build(String cc, String arch) {
 	def result = build job: 'Cforall/master', 		\
 		parameters: [						\
+			[$class: 'StringParameterValue', 		\
+			  name: 'pCompiler', 				\
+			  value: cc],					\
+			[$class: 'StringParameterValue', 		\
+			  name: 'pArchitecture', 			\
+			  value: arch],					\
 			[$class: 'BooleanParameterValue', 		\
-			  name: 'isFullBuild', 				\
+			  name: 'pRunAllTests', 			\
 			  value: true], 					\
-			[$class: 'StringParameterValue', 		\
-			  name: 'buildArchitecture', 			\
-			  value: arch]					\
+			[$class: 'BooleanParameterValue', 		\
+			  name: 'pRunBenchmark', 			\
+			  value: true], 					\
+			[$class: 'BooleanParameterValue', 		\
+			  name: 'pBuildDocumentation', 		\
+			  value: true], 					\
+			[$class: 'BooleanParameterValue', 		\
+			  name: 'pPublish', 				\
+			  value: true], 					\
+			[$class: 'BooleanParameterValue', 		\
+			  name: 'pSilent', 				\
+			  value: true], 					\
 		],								\
 		propagate: false
@@ -69,59 +141,4 @@
 
 //===========================================================================================================
-// Main loop of the compilation
-//===========================================================================================================
-
-node ('master') {
-	def err = null
-
-	try {
-		//Prevent the build from exceeding 30 minutes
-		timeout(60) {
-
-			//Wrap build to add timestamp to command line
-			wrap([$class: 'TimestamperBuildWrapper']) {
-
-				stage 'Build'
-
-					results = [null, null]
-
-					parallel (
-						x64: {
-							trigger_build('64-bit')
-						},
-						x32: {
-							trigger_build('32-bit')
-						}
-					)
-
-				//Push latest changes to do-lang repo
-				push_build()
-			}
-		}
-	}
-
-	//If an exception is caught we need to change the status and remember to
-	//attach the build log to the email
-	catch (Exception caughtError) {
-		echo('error caught')
-
-		//rethrow error later
-		err = caughtError
-
-		//Store the result of the build log
-		currentBuild.result = 'FAILURE'
-
-		//Send email to notify the failure
-		promote_failure_email()
-	}
-
-	finally {
-		//Must re-throw exception to propagate error
-		if (err) {
-			throw err
-		}
-	}
-}
-//===========================================================================================================
 //Routine responsible of sending the email notification once the build is completed
 //===========================================================================================================
Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ Jenkinsfile	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -2,214 +2,51 @@
 
 //===========================================================================================================
-// Main compilation routines
-//===========================================================================================================
-//Compilation script is done here but environnement set-up and error handling is done in main loop
-def cfa_build(boolean full_build, String flags) {
-	build_stage 'Checkout'
-		def install_dir = pwd tmp: true
-		//checkout the source code and clean the repo
-		checkout scm
-
-		//Clean all temporary files to make sure no artifacts of the previous build remain
-		sh 'git clean -fdqx'
-
-		//Reset the git repo so no local changes persist
-		sh 'git reset --hard'
-
-	build_stage 'Build'
-
-		//Configure the conpilation (Output is not relevant)
-		//Use the current directory as the installation target so nothing
-		//escapes the sandbox
-		//Also specify the compiler by hand
-		sh "./configure CXX=${currentCC.cpp_cc} ${flags} --with-backend-compiler=${currentCC.cfa_backend_cc} --prefix=${install_dir} --enable-silent-rules --quiet"
-
-		//Compile the project
-		sh 'make -j 8 --no-print-directory V=0 install'
-
-	build_stage 'Test'
-
-		//Run the tests from the tests directory
-		if (full_build) {
-			sh 'make -C src/tests all-tests debug=yes'
-			sh 'make -C src/tests all-tests debug=no'
-		}
-		else {
-			sh 'make -C src/tests'
-		}
-
-	build_stage 'Cleanup'
-
-		//do a maintainer-clean to make sure we need to remake from scratch
-		sh 'make maintainer-clean > /dev/null'
-}
-
-def make_doc() {
-	def err = null
-
-	try {
-		sh 'make clean > /dev/null'
-		sh 'make > /dev/null 2>&1'
-	}
-
-	catch (Exception caughtError) {
-		//rethrow error later
-		err = caughtError
-
-		sh 'cat *.log'
-	}
-
-	finally {
-		/* Must re-throw exception to propagate error */
-		if (err) {
-			throw err
-		}
-	}
-}
-
-def doc_build() {
-	stage 'Documentation'
-
-		status_prefix = 'Documentation'
-
-		dir ('doc/user') {
-			make_doc()
-		}
-
-		dir ('doc/refrat') {
-			make_doc()
-		}
-}
-
-def benchmark() {
-	stage 'Benchmark'
-
-		status_prefix = 'Documentation'
-
-		// //We can't just write to a file outside our repo
-		// //Copy the file locally using ssh
-		// sh 'scp plg2.cs.uwaterloo.ca:/u/cforall/public_html/perf-history/concurrency.csv bench.csv'
-
-		// //Then append to the local file
-		// sh 'make -C src/benchmark csv-data >> bench.csv'
-
-		// //Then publish the file again
-		// sh 'scp bench.csv plg2.cs.uwaterloo.ca:/u/cforall/public_html/perf-history/concurrency.csv'		
-}
-
-//===========================================================================================================
-// Helper classes/variables/routines to make the status and stage name easier to use
-//===========================================================================================================
-//Description of a compiler (Must be serializable since pipelines are persistent)
-class CC_Desc implements Serializable {
-	public String cc_name
-	public String cpp_cc
-	public String cfa_backend_cc
-
-	CC_Desc(String cc_name, String cpp_cc, String cfa_backend_cc) {
-		this.cc_name = cc_name
-		this.cpp_cc = cpp_cc
-		this.cfa_backend_cc = cfa_backend_cc
-	}
-}
-
-//Global Variables defining the compiler and at which point in the build we are
-// These variables are used but can't be declared before hand because of wierd scripting rules
-// @Field String currentCC
-// @Field String status_prefix
-
-//Wrapper to sync stage name and status name
-def build_stage(String name) {
-	def stage_name = "${currentCC.cc_name} ${name}".trim()
-	stage stage_name
-
-		status_prefix = stage_name
-}
-
-//Helper routine to collect information about the git history
-def collect_git_info() {
-
-	//create the temporary output directory in case it doesn't already exist
-	def out_dir = pwd tmp: true
-	sh "mkdir -p ${out_dir}"
-
-	//parse git logs to find what changed
-	gitRefName = env.BRANCH_NAME
-	dir("../${gitRefName}@script") {
-		sh "git reflog > ${out_dir}/GIT_COMMIT"
-	}
-	git_reflog = readFile("${out_dir}/GIT_COMMIT")
-	gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
-	gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
-}
-
-//===========================================================================================================
 // Main loop of the compilation
 //===========================================================================================================
 node ('master'){
 
-	boolean bIsFullBuild
+	boolean bIsSandbox = env.BRANCH_NAME == "jenkins-sandbox"
 	def err = null
 	def log_needed = false
+
+	stage_name 		= ''
+
+	compiler 		= null
+	architecture 	= ''
+	
+	do_alltests		= false
+	do_benchmark	= false
+	do_doc		= false
+	do_publish		= false
+	do_sendemail	= true
+
 	currentBuild.result = "SUCCESS"
-	status_prefix = ''
 
 	try {
-		//Prevent the build from exceeding 30 minutes
-		timeout(60) {
-
-			//Wrap build to add timestamp to command line
-			wrap([$class: 'TimestamperBuildWrapper']) {
-
-				collect_git_info()
-
-				properties ([ 									\
-					[$class: 'ParametersDefinitionProperty', 				\
-						parameterDefinitions: [ 					\
-						[$class: 'BooleanParameterDefinition',  			\
-						  defaultValue: false,  					\
-						  description: 'If true, the build will be promoted to the do-lang git repository (on successful builds only)', \
-						  name: 'isFullBuild' 					\
-						], 								\
-						[$class: 'ChoiceParameterDefinition',				\
-						  choices: '64-bit\n32-bit',					\
-						  defaultValue: '64-bit',					\
-						  description: 'The architecture to use for compilation',	\
-						  name: 'buildArchitecture'					\
-						]]								\
-					]])
-
-				bIsSandbox = env.BRANCH_NAME == "jenkins-sandbox"
-				bIsFullBuild = isFullBuild == 'true'
-				architectureFlag = ''
-				if (buildArchitecture == '64-bit') {
-					architectureFlag = '--host=x86_64 CXXFLAGS="-m64" CFAFLAGS="-m64"'
-				} else if (buildArchitecture == '32-bit'){
-					architectureFlag = '--host=i386 CXXFLAGS="-m32" CFAFLAGS="-m32"'
-				} else {
-					architectureFlag = 'ERROR'
-				}
-
-				echo "FULL BUILD = ${isFullBuild}\nArchitecture = ${buildArchitecture} (flag ${architectureFlag})"
-
-				//Compile using gcc-4.9
-				currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')
-				cfa_build(bIsFullBuild, architectureFlag)
-
-				//Compile latex documentation
-				doc_build()
-
-				//Run benchmark and save result
+		//Wrap build to add timestamp to command line
+		wrap([$class: 'TimestamperBuildWrapper']) {
+
+			//Prevent the build from exceeding 60 minutes
+			timeout(60) {
+
+				notify_server()
+
+				prepare_build()
+
+				checkout()
+
+				build()
+
+				test()
+
 				benchmark()
 
-				if( bIsFullBuild ) {
-					//Compile using gcc-5
-					currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
-					cfa_build(true, architectureFlag)
-
-					//Compile using gcc-4.9
-					currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
-					cfa_build(true, architectureFlag)
-				}
+				clean()
+
+				build_doc()
+
+				publish()
+
+				notify_server()
 			}
 		}
@@ -226,15 +63,15 @@
 
 		//Store the result of the build log
-		currentBuild.result = "${status_prefix} FAILURE".trim()
+		currentBuild.result = "${stage_name} FAILURE".trim()
 	}
 
 	finally {
-		echo 'Build Completed'
-
 		//Send email with final results if this is not a full build
-		if( !bIsFullBuild && !bIsSandbox ) {
+		if( do_sendemail && !bIsSandbox ) {
 			echo 'Notifying users of result'
 			email(currentBuild.result, log_needed)
 		}
+
+		echo 'Build Completed'
 
 		/* Must re-throw exception to propagate error */
@@ -243,4 +80,245 @@
 		}
 	}
+}
+
+//===========================================================================================================
+// Helper classes/variables/routines
+//===========================================================================================================
+//Helper routine to collect information about the git history
+def collect_git_info() {
+
+	//create the temporary output directory in case it doesn't already exist
+	def out_dir = pwd tmp: true
+	sh "mkdir -p ${out_dir}"
+
+	//parse git logs to find what changed
+	gitRefName = env.BRANCH_NAME
+	dir("../${gitRefName}@script") {
+		sh "git reflog > ${out_dir}/GIT_COMMIT"
+	}
+	git_reflog = readFile("${out_dir}/GIT_COMMIT")
+	gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
+	gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
+}
+
+def prepare_build() {
+	properties ([ 													\
+		[$class: 'ParametersDefinitionProperty', 								\
+			parameterDefinitions: [ 									\
+				[$class: 'ChoiceParameterDefinition',						\
+					description: 'Which compiler to use',					\
+					name: 'pCompiler',								\
+					choices: 'gcc-6\ngcc-5\ngcc-4.9\nclang',					\
+					defaultValue: 'gcc-6',								\
+				],												\
+				[$class: 'ChoiceParameterDefinition',						\
+					description: 'The target architecture',					\
+					name: 'pArchitecture',								\
+					choices: 'x64\nx86',								\
+					defaultValue: 'x64',								\
+				],												\
+				[$class: 'BooleanParameterDefinition',  						\
+					description: 'If false, only the quick test suite is ran', 		\
+					name: 'pRunAllTests', 								\
+					defaultValue: false,  								\
+				], 												\
+				[$class: 'BooleanParameterDefinition',  						\
+					description: 'If true, jenkins also runs benchmarks', 		\
+					name: 'pRunBenchmark', 								\
+					defaultValue: true,  								\
+				], 												\
+				[$class: 'BooleanParameterDefinition',  						\
+					description: 'If true, jenkins also builds documentation', 		\
+					name: 'pBuildDocumentation', 								\
+					defaultValue: true,  								\
+				],												\
+				[$class: 'BooleanParameterDefinition',  						\
+					description: 'If true, jenkins also publishes results', 		\
+					name: 'pPublish', 								\
+					defaultValue: true,  								\
+				],												\
+				[$class: 'BooleanParameterDefinition',  						\
+					description: 'If true, jenkins will not send emails', 		\
+					name: 'pSilent', 						\
+					defaultValue: false,  								\
+				],												\
+			],
+		]])
+
+	compiler 		= compiler_from_params( pCompiler )
+	architecture 	= architecture_from_params( pArchitecture )
+
+	do_alltests		= (pRunAllTests == 'true')
+	do_benchmark	= (pRunBenchmark == 'true')
+	do_doc		= (pBuildDocumentation == 'true')
+	do_publish		= (pPublish == 'true')
+	do_sendemail	= ! (pSilent == 'true')
+
+	echo """Compiler 		: ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc})
+Architecture		: ${architecture}
+Run All Tests		: ${ pRunAllTests.toString() }
+Run Benchmark		: ${ pRunBenchmark.toString() }
+Build Documentation	: ${ pBuildDocumentation.toString() }
+Publish		: ${ pPublish.toString() }
+Silent			: ${ pSilent.toString() }
+"""
+
+	collect_git_info()
+}
+
+def build_stage(String name) {
+	stage_name = name
+	stage name
+}
+
+def notify_server() {
+	sh 'curl --silent -X POST http://plg2:8082/jenkins/notify > /dev/null'
+	return
+}
+
+def make_doc() {
+	def err = null
+	try {
+		sh 'make clean > /dev/null'
+		sh 'make > /dev/null 2>&1'
+	} 
+	catch (Exception caughtError) {
+		err = caughtError //rethrow error later
+		sh 'cat *.log'
+	}
+	finally {
+		if (err) throw err // Must re-throw exception to propagate error
+	}
+}
+
+//Description of a compiler (Must be serializable since pipelines are persistent)
+class CC_Desc implements Serializable {
+	public String cc_name
+	public String cpp_cc
+	public String cfa_cc
+
+	CC_Desc(String cc_name, String cpp_cc, String cfa_cc) {
+		this.cc_name = cc_name
+		this.cpp_cc = cpp_cc
+		this.cfa_cc = cfa_cc
+	}
+}
+
+def compiler_from_params(cc) {
+	switch( cc ) {
+		case 'gcc-6':
+			return new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
+		break
+		case 'gcc-5':
+			return new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
+		break
+		case 'gcc-4.9':
+			return new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')
+		break
+		case 'clang':
+			return new CC_Desc('clang', 'clang++', 'gcc-6')
+		break
+		default :
+			error "Unhandled compiler : ${cc}"
+	}
+}
+
+def architecture_from_params( arch ) {
+	switch( arch ) {
+		case 'x64':
+			return '--host=x86_64 CXXFLAGS="-m64" CFAFLAGS="-m64"'
+		break
+		case 'x86':
+			return '--host=i386   CXXFLAGS="-m32" CFAFLAGS="-m32"'
+		break
+		default :
+			error "Unhandled architecture : ${arch}"
+	}
+}
+
+//===========================================================================================================
+// Main compilation routines
+//===========================================================================================================
+//Compilation script is done here but environnement set-up and error handling is done in main loop
+def checkout() {
+	build_stage'Checkout'
+		//checkout the source code and clean the repo
+		checkout scm
+
+		//Clean all temporary files to make sure no artifacts of the previous build remain
+		sh 'git clean -fdqx'
+
+		//Reset the git repo so no local changes persist
+		sh 'git reset --hard'
+}
+
+def build() {
+	build_stage'Build'
+	
+		def install_dir = pwd tmp: true
+		
+		//Configure the conpilation (Output is not relevant)
+		//Use the current directory as the installation target so nothing
+		//escapes the sandbox
+		//Also specify the compiler by hand
+		sh "./configure CXX=${compiler.cpp_cc} ${architecture} --with-backend-compiler=${compiler.cfa_cc} --prefix=${install_dir} --enable-silent-rules --quiet"
+
+		//Compile the project
+		sh 'make -j 8 --no-print-directory V=0 install'
+}
+
+def test() {
+	build_stage'Test'
+
+		//Run the tests from the tests directory
+		if ( do_alltests ) {
+			sh 'make -C src/tests all-tests debug=yes'
+			sh 'make -C src/tests all-tests debug=no'
+		}
+		else {
+			sh 'make -C src/tests'
+		}
+}
+
+def benchmark() {
+	build_stage'Benchmark'
+
+		if( !do_benchmark ) return
+
+		//Write the commit id to Benchmark
+		writeFile  file: 'bench.csv', text:'data=' + gitRefNewValue + ',' 
+ 
+		//Append bench results
+		sh 'make -C src/benchmark --no-print-directory csv-data >> bench.csv'
+}
+
+def clean() {
+	build_stage'Cleanup'
+
+		//do a maintainer-clean to make sure we need to remake from scratch
+		sh 'make maintainer-clean > /dev/null'
+}
+
+def build_doc() {
+	build_stage'Documentation'
+
+		if( !do_doc ) return
+
+		dir ('doc/user') {
+			make_doc()
+		}
+
+		dir ('doc/refrat') {
+			make_doc()
+		}
+}
+
+def publish() {
+	build_stage'Publish'
+
+		if( !do_publish ) return
+
+		//Then publish the results
+		sh 'curl --silent --data @bench.csv http://plg2:8082/jenkins/publish > /dev/null'
 }
 
Index: doc/LaTeXmacros/common.tex
===================================================================
--- doc/LaTeXmacros/common.tex	(revision 131dbb3d82aef2a9cc8891fa118693613534833d)
+++ doc/LaTeXmacros/common.tex	(revision 356c62a238fe292d70005ba5d8b3dcaf903bbca0)
@@ -248,6 +248,6 @@
 	morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto,
 		_Bool,catch,catchResume,choose,_Complex,__complex,__complex__,__const,__const__,disable,dtype,enable,__extension__,
-		fallthrough,fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,otype,restrict,_Static_assert,
-		_Thread_local,throw,throwResume,trait,try,typeof,__typeof,__typeof__,},
+		fallthrough,fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,one_t,otype,restrict,_Static_assert,
+		_Thread_local,throw,throwResume,trait,try,typeof,__typeof,__typeof__,zero_t},
 }%
 
@@ -263,5 +263,5 @@
 escapechar=§,											% LaTeX escape in CFA code §...§ (section symbol), emacs: C-q M-'
 mathescape=true,										% LaTeX math escape in CFA code $...$
-%keepspaces=true,										% 
+%keepspaces=true,										%
 showstringspaces=false,									% do not show spaces with cup
 showlines=true,											% show blank lines at end of code
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;
