Index: Jenkins/FullBuild
===================================================================
--- Jenkins/FullBuild	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ Jenkins/FullBuild	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -20,12 +20,12 @@
 
 					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' ) },
+						gcc_6_x64: { trigger_build( 'gcc-6',   'x64', true  ) },
+						gcc_6_x86: { trigger_build( 'gcc-6',   'x86', true  ) },
+						gcc_5_x64: { trigger_build( 'gcc-5',   'x64', false ) },
+						gcc_5_x86: { trigger_build( 'gcc-5',   'x86', false ) },
+						gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64', false ) },
+						gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86', false ) },
+						clang_x64: { trigger_build( 'clang',   'x64', false ) },
+						clang_x86: { trigger_build( 'clang',   'x86', false ) },
 					)
 
@@ -62,5 +62,5 @@
 //===========================================================================================================
 
-def trigger_build(String cc, String arch) {
+def trigger_build(String cc, String arch, Boolean publish) {
 	def result = build job: 'Cforall/master', 		\
 		parameters: [						\
@@ -82,5 +82,5 @@
 			[$class: 'BooleanParameterValue', 		\
 			  name: 'pPublish', 				\
-			  value: true], 					\
+			  value: publish], 					\
 			[$class: 'BooleanParameterValue', 		\
 			  name: 'pSilent', 				\
Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ Jenkinsfile	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -13,4 +13,5 @@
 
 	compiler 		= null
+	arch_name 		= ''
 	architecture 	= ''
 	
@@ -130,5 +131,5 @@
 				[$class: 'BooleanParameterDefinition',  						\
 					description: 'If true, jenkins also builds documentation', 		\
-					name: 'pBuildDocumentation', 								\
+					name: 'pBuildDocumentation', 							\
 					defaultValue: true,  								\
 				],												\
@@ -136,9 +137,9 @@
 					description: 'If true, jenkins also publishes results', 		\
 					name: 'pPublish', 								\
-					defaultValue: true,  								\
+					defaultValue: false,  								\
 				],												\
 				[$class: 'BooleanParameterDefinition',  						\
 					description: 'If true, jenkins will not send emails', 		\
-					name: 'pSilent', 						\
+					name: 'pSilent', 									\
 					defaultValue: false,  								\
 				],												\
@@ -147,5 +148,6 @@
 
 	compiler 		= compiler_from_params( pCompiler )
-	architecture 	= architecture_from_params( pArchitecture )
+	arch_name		= pArchitecture
+	architecture 	= architecture_from_params( arch_name )
 
 	do_alltests		= (pRunAllTests == 'true')
@@ -156,5 +158,6 @@
 
 	echo """Compiler 		: ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc})
-Architecture		: ${architecture}
+Architecture		: ${arch_name}
+Arc Flags		: ${architecture}
 Run All Tests		: ${ pRunAllTests.toString() }
 Run Benchmark		: ${ pRunBenchmark.toString() }
@@ -287,5 +290,5 @@
 
 		//Write the commit id to Benchmark
-		writeFile  file: 'bench.csv', text:'data=' + gitRefNewValue + ',' 
+		writeFile  file: 'bench.csv', text:'data=' + gitRefNewValue + ',' + arch_name + ','
  
 		//Append bench results
Index: doc/proposals/concurrency/thePlan.md
===================================================================
--- doc/proposals/concurrency/thePlan.md	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ doc/proposals/concurrency/thePlan.md	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -7,5 +7,5 @@
 
 _Phase 2_ : Minimum Viable Product
-Monitor type and enter/leave mutex member routines
+done - Monitor type and enter/leave mutex member routines
 Monitors as a language feature (not calling enter/leave by hand)
 Internal scheduling
Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/CodeGen/CodeGenerator.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Mar  5 17:13:33 2017
-// Update Count     : 475
+// Last Modified On : Mon Mar 13 23:56:59 2017
+// Update Count     : 477
 //
 
@@ -895,5 +895,5 @@
 
 	void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) {
-		if ( decl->get_storageClasses().any() ) {
+		if ( decl->get_storageClasses().val != 0 ) {
 			DeclarationNode::print_StorageClass( output, decl->get_storageClasses() );
 		} // if
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Common/utility.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -265,4 +265,18 @@
 reverse_iterate_t< T > reverseIterate( T & ref ) {
 	return reverse_iterate_t< T >( ref );
+}
+
+template< typename OutType, typename Range, typename Functor >
+OutType map_range( const Range& range, Functor&& functor ) {
+	OutType out;
+
+	std::transform(
+		begin( range ),
+		end( range ),
+		std::back_inserter( out ),
+		std::forward< Functor >( functor )
+	);
+
+	return out;
 }
 
Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Concurrency/Keywords.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -0,0 +1,234 @@
+//                              -*- Mode: CPP -*-
+//
+// 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.
+//
+// Keywords.cc --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Mar 13 12:41:22 2017
+// Last Modified By :
+// Last Modified On :
+// Update Count     : 0
+//
+
+#include "Concurrency/Keywords.h"
+
+#include "SynTree/Declaration.h"
+#include "SynTree/Expression.h"
+#include "SynTree/Initializer.h"
+#include "SynTree/Mutator.h"
+#include "SynTree/Statement.h"
+#include "SynTree/Type.h"
+#include "SynTree/Visitor.h"
+
+namespace Concurrency {
+
+	namespace {
+		const std::list<Label> noLabels;
+		DeclarationNode::StorageClasses noStorage;
+		Type::Qualifiers noQualifiers;
+	}
+
+	//=============================================================================================
+	// Visitors declaration
+	//=============================================================================================
+
+	//-----------------------------------------------------------------------------
+	//Handles thread type declarations :
+	// thread Mythread {                         struct MyThread {
+	// 	int data;                                  int data;
+	// 	a_struct_t more_data;                      a_struct_t more_data;
+	//                                =>             thread_desc __thrd_d;
+	// };                                        };
+	//                                           static inline thread_desc * get_thread( MyThread * this ) { return &this->__thrd_d; }
+	//                                           void main( MyThread * this );
+	//
+	class ThreadKeyword final : public Mutator {
+	  public:
+
+		static void implement( std::list< Declaration * > & translationUnit ) {}
+	};
+
+	//-----------------------------------------------------------------------------
+	//Handles coroutine type declarations :
+	// coroutine MyCoroutine {                   struct MyCoroutine {
+	// 	int data;                                  int data;
+	// 	a_struct_t more_data;                      a_struct_t more_data;
+	//                                =>             coroutine_desc __cor_d;
+	// };                                        };
+	//                                           static inline coroutine_desc * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
+	//                                           void main( MyCoroutine * this );
+	//
+	class CoroutineKeyword final : public Mutator {
+	  public:
+
+		static void implement( std::list< Declaration * > & translationUnit ) {}
+	};
+
+	//-----------------------------------------------------------------------------
+	//Handles monitor type declarations :
+	// monitor MyMonitor {                       struct MyMonitor {
+	// 	int data;                                  int data;
+	// 	a_struct_t more_data;                      a_struct_t more_data;
+	//                                =>             monitor_desc __mon_d;
+	// };                                        };
+	//                                           static inline monitor_desc * get_coroutine( MyMonitor * this ) { return &this->__cor_d; }
+	//                                           void main( MyMonitor * this );
+	//
+	class MonitorKeyword final : public Mutator {
+	  public:
+
+		static void implement( std::list< Declaration * > & translationUnit ) {}
+	};
+
+	//-----------------------------------------------------------------------------
+	//Handles mutex routines definitions :
+	// void foo( A * mutex a, B * mutex b,  int i ) {                  void foo( A * a, B * b,  int i ) {
+	// 	                                                                 monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
+	// 	                                                                 monitor_guard_t __guard = { __monitors, 2 };
+	//    /*Some code*/                                       =>           /*Some code*/
+	// }                                                               }
+	//
+	class MutexKeyword final : public Visitor {
+	  public:
+
+		using Visitor::visit;
+		virtual void visit( FunctionDecl *functionDecl ) override final;
+		virtual void visit(   StructDecl *functionDecl ) override final;
+
+		std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );
+		void validate( DeclarationWithType * );
+		void addStatments( CompoundStmt *, const std::list<DeclarationWithType * > &);
+
+		static void implement( std::list< Declaration * > & translationUnit ) {
+			MutexKeyword impl;
+			acceptAll( translationUnit, impl );
+		}
+
+	  private:
+	  	StructDecl* monitor_decl = nullptr;
+	};
+
+	//=============================================================================================
+	// General entry routine
+	//=============================================================================================
+	void applyKeywords( std::list< Declaration * > & translationUnit ) {
+		ThreadKeyword	::implement( translationUnit );
+		CoroutineKeyword	::implement( translationUnit );
+		MonitorKeyword	::implement( translationUnit );
+		MutexKeyword	::implement( translationUnit );
+	}
+
+	//=============================================================================================
+	// Mutex keyword implementation
+	//=============================================================================================
+	void MutexKeyword::visit(FunctionDecl* decl) {
+		std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl );
+		if( mutexArgs.empty() ) return;
+
+		for(auto arg : mutexArgs) {
+			validate( arg );
+		}
+
+		CompoundStmt* body = decl->get_statements();
+		if( ! body ) return;
+
+		assert(monitor_decl);
+		addStatments( body, mutexArgs );
+	}
+
+	void MutexKeyword::visit(StructDecl* decl) {
+		if( decl->get_name() == "monitor_desc" ) {
+			assert( !monitor_decl );
+			monitor_decl = decl;
+		}
+	}
+
+	std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl ) {
+		std::list<DeclarationWithType*> mutexArgs;
+
+		for( auto arg : decl->get_functionType()->get_parameters()) {
+			//Find mutex arguments
+			Type* ty = arg->get_type();
+			if( ! ty->get_qualifiers().isMutex ) continue;
+
+			//Append it to the list
+			mutexArgs.push_back( arg );
+		}
+
+		return mutexArgs;
+	}
+
+	void MutexKeyword::validate( DeclarationWithType * arg ) {
+		Type* ty = arg->get_type();
+
+		//Makes sure it's not a copy
+		PointerType* pty = dynamic_cast< PointerType * >( ty );
+		if( ! pty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg );
+
+		//Make sure the we are pointing directly to a type
+		Type* base = pty->get_base();
+		if(  dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
+
+		//Make sure that typed isn't mutex
+		if( ! base->get_qualifiers().isMutex ) throw SemanticError( "mutex keyword may only appear once per argument ", arg );
+	}
+
+	void MutexKeyword::addStatments( CompoundStmt * body, const std::list<DeclarationWithType * > & args ) {
+
+		ObjectDecl * monitors = new ObjectDecl(
+			"__monitors",
+			noStorage,
+			LinkageSpec::Cforall,
+			nullptr,
+			new ArrayType(
+				noQualifiers,
+				new PointerType(
+					noQualifiers,
+					new StructInstType(
+						noQualifiers,
+						monitor_decl
+					)
+				),
+				new ConstantExpr( Constant::from_ulong( args.size() ) ),
+				false,
+				false
+			),
+			new ListInit(
+				map_range < std::list<Initializer*> > ( args, [](DeclarationWithType * var ){
+					return new SingleInit( new UntypedExpr(
+						new NameExpr( "get_monitor" ),
+						{  new VariableExpr( var ) }
+					) );
+				})
+			)
+		);
+
+		//in reverse order :
+		// monitor_guard_t __guard = { __monitors, # };
+		body->push_front(
+			new DeclStmt( noLabels, new ObjectDecl(
+				"__guard",
+				noStorage,
+				LinkageSpec::Cforall,
+				nullptr,
+				new StructInstType(
+					noQualifiers,
+					"monitor_guard_t"
+				),
+				new ListInit(
+					{
+						new SingleInit( new VariableExpr( monitors ) ),
+						new SingleInit( new ConstantExpr( Constant::from_ulong( args.size() ) ) )
+					}
+				)
+			))
+		);
+
+		//monitor_desc * __monitors[] = { a, b };
+		body->push_front( new DeclStmt( noLabels, monitors) );
+	}
+};
Index: src/Concurrency/Keywords.h
===================================================================
--- src/Concurrency/Keywords.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Concurrency/Keywords.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -0,0 +1,28 @@
+//                              -*- Mode: CPP -*-
+//
+// 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.
+//
+// Keywords.h --
+//
+// Author           : Thierry Delisle
+// Created On       : Fri Mar 10 15:16:42 2017
+// Last Modified By :
+// Last Modified On :
+// Update Count     : 0
+//
+
+#ifndef KEYWORDS_H
+#define KEYWORDS_H
+
+#include <list>
+
+#include "SynTree/Declaration.h"
+
+namespace Concurrency {
+	void applyKeywords( std::list< Declaration * > & translationUnit );
+};
+
+#endif //KEYWORDS_H
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/GenPoly/Box.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Mar  6 23:45:59 2017
-// Update Count     : 330
+// Last Modified On : Tue Mar 14 07:45:29 2017
+// Update Count     : 334
 //
 
@@ -299,7 +299,7 @@
 		// because each unit generates copies of the default routines for each aggregate.
 		FunctionDecl *layoutDecl = new FunctionDecl( layoutofName( typeDecl ),
-													 functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::StaticClass ),
+													 functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static ),
 													 LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ),
-													 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) );
+													 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) );
 		layoutDecl->fixUniqueId();
 		return layoutDecl;
Index: src/InitTweak/FixGlobalInit.cc
===================================================================
--- src/InitTweak/FixGlobalInit.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/InitTweak/FixGlobalInit.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 04 15:14:56 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Mar  6 23:14:19 2017
-// Update Count     : 14
+// Last Modified On : Mon Mar 13 23:58:27 2017
+// Update Count     : 16
 //
 
@@ -87,7 +87,7 @@
 			dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) );
 		}
-		initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
+		initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
 		initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) );
-		destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
+		destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
 		destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) );
 	}
@@ -143,3 +143,2 @@
 // compile-command: "make install" //
 // End: //
-
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/InitTweak/FixInit.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Wed Jan 13 16:29:30 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:51:40 2017
-// Update Count     : 59
+// Last Modified On : Tue Mar 14 08:05:28 2017
+// Update Count     : 63
 //
 
@@ -678,5 +678,5 @@
 				assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
 				if ( Statement * ctor = ctorInit->get_ctor() ) {
-					if ( objDecl->get_storageClasses()[ DeclarationNode::Static ] ) {
+					if ( objDecl->get_storageClasses().is_static ) {
 						// originally wanted to take advantage of gcc nested functions, but
 						// we get memory errors with this approach. To remedy this, the static
@@ -704,5 +704,5 @@
 						BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool );
 						SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant( boolType->clone(), "1" ) ), noDesignators );
-						ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::Cforall, 0, boolType, boolInitExpr );
+						ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, boolType, boolInitExpr );
 						isUninitializedVar->fixUniqueId();
 
@@ -731,5 +731,5 @@
 
 							// void __objName_dtor_atexitN(...) {...}
-							FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
+							FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
 							dtorCaller->fixUniqueId();
 							dtorCaller->get_statements()->push_back( dtorStmt );
@@ -764,5 +764,5 @@
 							// create a new object which is never used
 							static UniqueName dummyNamer( "_dummy" );
-							ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
+							ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
 							return dummy;
 						}
@@ -821,5 +821,5 @@
 		void InsertDtors::visit( ObjectDecl * objDecl ) {
 			// remember non-static destructed objects so that their destructors can be inserted later
-			if ( ! objDecl->get_storageClasses()[ DeclarationNode::Static ] ) {
+			if ( ! objDecl->get_storageClasses().is_static ) {
 				if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
 					// a decision should have been made by the resolver, so ctor and init are not both non-NULL
Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/InitTweak/GenInit.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:51:38 2017
-// Update Count     : 179
+// Last Modified On : Mon Mar 13 23:59:09 2017
+// Update Count     : 180
 //
 
@@ -186,5 +186,5 @@
 		// C doesn't allow variable sized arrays at global scope or for static variables, so don't hoist dimension.
 		if ( ! inFunction ) return;
-		if ( storageClasses[ DeclarationNode::StaticClass] ) return;
+		if ( storageClasses.is_static ) return;
 
 		if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) {
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/InitTweak/InitTweak.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -260,5 +260,5 @@
 			(objDecl->get_init() == NULL ||
 				( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ))
-			&& ! objDecl->get_storageClasses()[ DeclarationNode::Extern ];
+			&& ! objDecl->get_storageClasses().is_extern;
 	}
 
Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Parser/DeclarationNode.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 12:34:05 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 17:28:56 2017
-// Update Count     : 937
+// Last Modified On : Tue Mar 14 14:45:52 2017
+// Update Count     : 973
 //
 
@@ -90,6 +90,6 @@
 	newnode->type = maybeClone( type );
 	newnode->storageClasses = storageClasses;
+	newnode->funcSpecs = funcSpecs;
 	newnode->bitfieldWidth = maybeClone( bitfieldWidth );
-	newnode->funcSpecs = funcSpecs;
 	newnode->enumeratorValue.reset( maybeClone( enumeratorValue.get() ) );
 	newnode->hasEllipsis = hasEllipsis;
@@ -117,5 +117,5 @@
 
 void DeclarationNode::print_StorageClass( std::ostream & output, StorageClasses storageClasses ) {
-	if ( storageClasses.any() ) {								// function specifiers?
+	if ( storageClasses.val != 0 ) {					// storage classes ?
 		for ( unsigned int i = 0; i < DeclarationNode::NoStorageClass; i += 1 ) {
 			if ( storageClasses[i] ) {
@@ -127,5 +127,5 @@
 
 void DeclarationNode::print_FuncSpec( std::ostream & output, DeclarationNode::FuncSpecifiers funcSpec ) {
-	if ( funcSpec.any() ) {								// function specifiers?
+	if ( funcSpec.val != 0 ) {							// function specifiers ?
 		for ( unsigned int i = 0; i < DeclarationNode::NoFuncSpecifier; i += 1 ) {
 			if ( funcSpec[i] ) {
@@ -202,20 +202,20 @@
 
 
-DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClass sc ) {
-	DeclarationNode * newnode = new DeclarationNode;
-	newnode->storageClasses[ sc ] = true;
+DeclarationNode * DeclarationNode::newStorageClass( StorageClasses sc ) {
+	DeclarationNode * newnode = new DeclarationNode;
+	newnode->storageClasses = sc;
 	return newnode;
 } // DeclarationNode::newStorageClass
 
-DeclarationNode * DeclarationNode::newFuncSpecifier( DeclarationNode::FuncSpecifier fs ) {
-	DeclarationNode * newnode = new DeclarationNode;
-	newnode->funcSpecs[ fs ] = true;
+DeclarationNode * DeclarationNode::newFuncSpecifier( FuncSpecifiers fs ) {
+	DeclarationNode * newnode = new DeclarationNode;
+	newnode->funcSpecs = fs;
 	return newnode;
 } // DeclarationNode::newFuncSpecifier
 
-DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifier tq ) {
+DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifiers tq ) {
 	DeclarationNode * newnode = new DeclarationNode;
 	newnode->type = new TypeData();
-	newnode->type->typeQualifiers[ tq ] = true;
+	newnode->type->typeQualifiers = tq;
 	return newnode;
 } // DeclarationNode::newQualifier
@@ -457,8 +457,8 @@
 
 void DeclarationNode::checkQualifiers( const TypeData * src, const TypeData * dst ) {
-	const TypeData::TypeQualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization
-
-	if ( (qsrc & qdst).any() ) {						// common qualifier ?
-		for ( unsigned int i = 0; i < NoTypeQualifier; i += 1 ) { // find common qualifiers
+	const TypeQualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization
+
+	if ( (qsrc.val & qdst.val) != 0 ) {					// duplicates ?
+		for ( unsigned int i = 0; i < NoTypeQualifier; i += 1 ) { // find duplicates
 			if ( qsrc[i] && qdst[i] ) {
 				appendError( error, string( "duplicate " ) + DeclarationNode::typeQualifierNames[i] );
@@ -469,6 +469,6 @@
 
 void DeclarationNode::checkSpecifiers( DeclarationNode * src ) {
-	if ( (funcSpecs & src->funcSpecs).any() ) {			// common specifier ?
-		for ( unsigned int i = 0; i < NoFuncSpecifier; i += 1 ) { // find common specifier
+	if ( (funcSpecs.val & src->funcSpecs.val) != 0 ) {		  // duplicates ?
+		for ( unsigned int i = 0; i < NoFuncSpecifier; i += 1 ) { // find duplicates
 			if ( funcSpecs[i] && src->funcSpecs[i] ) {
 				appendError( error, string( "duplicate " ) + DeclarationNode::funcSpecifierNames[i] );
@@ -477,6 +477,6 @@
 	} // if
 
-	if ( storageClasses != 0 && src->storageClasses != 0 ) { // any reason to check ?
-		if ( (storageClasses & src->storageClasses).any() ) { // duplicates ?
+	if ( storageClasses.val != 0 && src->storageClasses.val != 0 ) { // any reason to check ?
+		if ( (storageClasses.val & src->storageClasses.val ) != 0 ) { // duplicates ?
 			for ( unsigned int i = 0; i < NoStorageClass; i += 1 ) { // find duplicates
 				if ( storageClasses[i] && src->storageClasses[i] ) {
@@ -485,8 +485,8 @@
 			} // for
 			// src is the new item being added and has a single bit
-		} else if ( ! src->storageClasses[ Threadlocal ] ) { // conflict ?
-			appendError( error, string( "conflicting " ) + storageClassNames[ffs( storageClasses.to_ulong() ) - 1] +
-						 " & " + storageClassNames[ffs( src->storageClasses.to_ulong() ) - 1] );
-			src->storageClasses.reset();				// FIX to preserve invariant of one basic storage specifier
+		} else if ( ! src->storageClasses.is_threadlocal ) { // conflict ?
+			appendError( error, string( "conflicting " ) + storageClassNames[ffs( storageClasses.val ) - 1] +
+						 " & " + storageClassNames[ffs( src->storageClasses.val ) - 1] );
+			src->storageClasses.val = 0;				// FIX to preserve invariant of one basic storage specifier
 		} // if
 	} // if
@@ -496,6 +496,6 @@
 
 DeclarationNode * DeclarationNode::copySpecifiers( DeclarationNode * q ) {
-	funcSpecs = funcSpecs | q->funcSpecs;
-	storageClasses = storageClasses | q->storageClasses;
+	funcSpecs.val = funcSpecs.val | q->funcSpecs.val;
+	storageClasses.val = storageClasses.val | q->storageClasses.val;
 
 	for ( Attribute *attr: reverseIterate( q->attributes ) ) {
@@ -520,5 +520,5 @@
 		src = nullptr;
 	} else {
-		dst->typeQualifiers |= src->typeQualifiers;
+		dst->typeQualifiers.val |= src->typeQualifiers.val;
 	} // if
 } // addQualifiersToType
@@ -578,10 +578,10 @@
 		switch ( dst->kind ) {
 		  case TypeData::Unknown:
-			src->typeQualifiers |= dst->typeQualifiers;
+			src->typeQualifiers.val |= dst->typeQualifiers.val;
 			dst = src;
 			src = nullptr;
 			break;
 		  case TypeData::Basic:
-			dst->typeQualifiers |= src->typeQualifiers;
+			dst->typeQualifiers.val |= src->typeQualifiers.val;
 			if ( src->kind != TypeData::Unknown ) {
 				assert( src->kind == TypeData::Basic );
@@ -619,5 +619,5 @@
 					dst->base->aggInst.params = maybeClone( src->aggregate.actuals );
 				} // if
-				dst->base->typeQualifiers |= src->typeQualifiers;
+				dst->base->typeQualifiers.val |= src->typeQualifiers.val;
 				src = nullptr;
 				break;
@@ -651,5 +651,5 @@
 						type->aggInst.hoistType = o->type->enumeration.body;
 					} // if
-					type->typeQualifiers |= o->type->typeQualifiers;
+					type->typeQualifiers.val |= o->type->typeQualifiers.val;
 				} else {
 					type = o->type;
@@ -807,5 +807,5 @@
 					p->type->base->aggInst.params = maybeClone( type->aggregate.actuals );
 				} // if
-				p->type->base->typeQualifiers |= type->typeQualifiers;
+				p->type->base->typeQualifiers.val |= type->typeQualifiers.val;
 				break;
 
@@ -844,5 +844,5 @@
 					lastArray->base->aggInst.params = maybeClone( type->aggregate.actuals );
 				} // if
-				lastArray->base->typeQualifiers |= type->typeQualifiers;
+				lastArray->base->typeQualifiers.val |= type->typeQualifiers.val;
 				break;
 			  default:
@@ -1058,5 +1058,5 @@
 		//    inline _Noreturn int g( int i );	// allowed
 		//    inline _Noreturn int i;			// disallowed
-		if ( type->kind != TypeData::Function && funcSpecs.any() ) {
+		if ( type->kind != TypeData::Function && funcSpecs.val != 0 ) {
 			throw SemanticError( "invalid function specifier for ", this );
 		} // if
@@ -1068,5 +1068,5 @@
 	//    inlne _Noreturn struct S { ... };		// disallowed
 	//    inlne _Noreturn enum   E { ... };		// disallowed
-	if ( funcSpecs.any() ) {
+	if ( funcSpecs.val != 0 ) {
 		throw SemanticError( "invalid function specifier for ", this );
 	} // if
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Parser/ParseNode.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 08:10:53 2017
-// Update Count     : 726
+// Last Modified On : Tue Mar 14 16:53:19 2017
+// Update Count     : 757
 //
 
@@ -19,5 +19,4 @@
 #include <string>
 #include <list>
-#include <bitset>
 #include <iterator>
 #include <memory>
@@ -204,9 +203,48 @@
 	// These must remain in the same order as the corresponding DeclarationNode names.
 
-	enum StorageClass { Extern, Static, Auto, Register, Threadlocal, NoStorageClass,
-						ExternClass = 1 << Extern, StaticClass = 1 << Static, AutoClass = 1 << Auto, RegisterClass = 1 << Register, ThreadlocalClass = 1 << Threadlocal };
-	enum FuncSpecifier { Inline, Noreturn, Fortran, NoFuncSpecifier,
-						 InlineSpec = 1 << Inline, NoreturnSpec = 1 << Noreturn, FortranSpec = 1 << Fortran };
-	enum TypeQualifier { Const, Restrict, Volatile, Lvalue, Mutex, Atomic, NoTypeQualifier };
+	enum { Extern = 1 << 0, Static = 1 << 1, Auto = 1 << 2, Register = 1 << 3, Threadlocal = 1 << 4, NoStorageClass = 5 };
+	union StorageClasses {
+		unsigned int val;
+		struct {
+			bool is_extern : 1;
+			bool is_static : 1;
+			bool is_auto : 1;
+			bool is_register : 1;
+			bool is_threadlocal : 1;
+		};
+		StorageClasses() : val( 0 ) {}
+		StorageClasses( unsigned int val ) : val( val ) {}
+		bool operator[]( unsigned int i ) const { return val & (1 << i); }
+	}; // StorageClasses
+
+	enum { Inline = 1 << 0, Noreturn = 1 << 1, Fortran = 1 << 2, NoFuncSpecifier = 3 };
+	union FuncSpecifiers {
+		unsigned int val;
+		struct {
+			bool is_inline : 1;
+			bool is_noreturn : 1;
+			bool is_fortran : 1;
+		};
+		FuncSpecifiers() : val( 0 ) {}
+		FuncSpecifiers( unsigned int val ) : val( val ) {}
+		bool operator[]( unsigned int i ) const { return val & (1 << i); }
+	}; // FuncSpecifiers
+
+	enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NoTypeQualifier = 6 };
+	union TypeQualifiers {
+		unsigned int val;
+		struct {
+			bool is_const : 1;
+			bool is_restrict : 1;
+			bool is_volatile : 1;
+			bool is_lvalue : 1;
+			bool is_mutex : 1;
+			bool is_atomic : 1;
+		};
+		TypeQualifiers() : val( 0 ) {}
+		TypeQualifiers( unsigned int val ) : val( val ) {}
+		bool operator[]( unsigned int i ) const { return val & (1 << i); }
+	}; // TypeQualifiers
+
 	enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType };
 	enum ComplexType { Complex, Imaginary, NoComplexType };
@@ -228,7 +266,7 @@
 	static const char * builtinTypeNames[];
 
-	static DeclarationNode * newStorageClass( StorageClass );
-	static DeclarationNode * newFuncSpecifier( FuncSpecifier );
-	static DeclarationNode * newTypeQualifier( TypeQualifier );
+	static DeclarationNode * newStorageClass( StorageClasses );
+	static DeclarationNode * newFuncSpecifier( FuncSpecifiers );
+	static DeclarationNode * newTypeQualifier( TypeQualifiers );
 	static DeclarationNode * newBasicType( BasicType );
 	static DeclarationNode * newComplexType( ComplexType );
@@ -326,9 +364,7 @@
 	TypeData * type;
 
-	typedef std::bitset< DeclarationNode::NoStorageClass > StorageClasses;
 	StorageClasses storageClasses;
 	static void print_StorageClass( std::ostream & output, StorageClasses storageClasses );
 
-	typedef std::bitset< DeclarationNode::NoFuncSpecifier > FuncSpecifiers;
 	FuncSpecifiers funcSpecs;
 	static void print_FuncSpec( std::ostream & output, FuncSpecifiers funcSpecs );
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Parser/TypeData.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:12:51 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 08:08:21 2017
-// Update Count     : 538
+// Last Modified On : Tue Mar 14 15:01:44 2017
+// Update Count     : 548
 //
 
@@ -26,5 +26,5 @@
 using namespace std;
 
-TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) {
+TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ {
 	switch ( kind ) {
 	  case Unknown:
@@ -50,4 +50,10 @@
 		function.newStyle = false;
 		break;
+		// Enum is an Aggregate, so both structures are initialized together.
+	  case Enum:
+		// enumeration = new Enumeration_t;
+		enumeration.name = nullptr;
+		enumeration.constants = nullptr;
+		enumeration.body = false;
 	  case Aggregate:
 		// aggregate = new Aggregate_t;
@@ -63,10 +69,4 @@
 		aggInst.params = nullptr;
 		aggInst.hoistType = false;;
-		break;
-	  case Enum:
-		// enumeration = new Enumeration_t;
-		enumeration.name = nullptr;
-		enumeration.constants = nullptr;
-		enumeration.body = false;
 		break;
 	  case Symbolic:
@@ -494,9 +494,9 @@
 Type::Qualifiers buildQualifiers( const TypeData * td ) {
 	Type::Qualifiers q;
-	q.isConst = td->typeQualifiers[ DeclarationNode::Const ];
-	q.isVolatile = td->typeQualifiers[ DeclarationNode::Volatile ];
-	q.isRestrict = td->typeQualifiers[ DeclarationNode::Restrict ];
-	q.isLvalue = td->typeQualifiers[ DeclarationNode::Lvalue ];
-	q.isAtomic = td->typeQualifiers[ DeclarationNode::Atomic ];;
+	q.isConst = td->typeQualifiers.is_const;
+	q.isVolatile = td->typeQualifiers.is_volatile;
+	q.isRestrict = td->typeQualifiers.is_restrict;
+	q.isLvalue = td->typeQualifiers.is_lvalue;
+	q.isAtomic = td->typeQualifiers.is_atomic;
 	return q;
 } // buildQualifiers
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Parser/TypeData.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,12 +10,10 @@
 // Created On       : Sat May 16 15:18:36 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar  8 22:28:33 2017
-// Update Count     : 174
+// Last Modified On : Tue Mar 14 16:51:26 2017
+// Update Count     : 181
 //
 
 #ifndef TYPEDATA_H
 #define TYPEDATA_H
-
-#include <bitset>
 
 #include "ParseNode.h"
@@ -77,6 +75,5 @@
 	DeclarationNode::BuiltinType builtintype = DeclarationNode::NoBuiltinType;
 
-	typedef std::bitset< DeclarationNode::NoTypeQualifier > TypeQualifiers;
-	TypeQualifiers typeQualifiers;
+	DeclarationNode::TypeQualifiers typeQualifiers;
 	DeclarationNode * forall;
 
Index: src/SymTab/Autogen.cc
===================================================================
--- src/SymTab/Autogen.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/SymTab/Autogen.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Thu Mar 03 15:45:56 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:42:44 2017
-// Update Count     : 51
+// Last Modified On : Tue Mar 14 07:45:00 2017
+// Update Count     : 54
 //
 
@@ -162,8 +162,8 @@
 		// because each unit generates copies of the default routines for each aggregate.
 //		DeclarationNode::StorageClass sc = functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static;
-		DeclarationNode::StorageClasses scs = functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::StaticClass );
+		DeclarationNode::StorageClasses scs = functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static );
 		LinkageSpec::Spec spec = isIntrinsic ? LinkageSpec::Intrinsic : LinkageSpec::AutoGen;
 		FunctionDecl * decl = new FunctionDecl( fname, scs, spec, ftype, new CompoundStmt( noLabels ),
-												std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) );
+												std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) );
 		decl->fixUniqueId();
 		return decl;
@@ -720,11 +720,11 @@
 					TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl );
 					newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr,
-																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
+																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );
 					newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr,
-																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
+																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );
 					newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genCopyType( inst ), nullptr,
-																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
+																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );
 					newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr,
-																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
+																		   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );
 					typeParams.push_back( newDecl );
 					done.insert( ty->get_baseType() );
Index: src/SymTab/Autogen.h
===================================================================
--- src/SymTab/Autogen.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/SymTab/Autogen.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -58,5 +58,5 @@
 			assert( type );
 			Type * castType = type->clone();
-			castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true);
+			castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false);
 			castType->set_isLvalue( true ); // xxx - might not need this
 			dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) );
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/SymTab/Indexer.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:37:33 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:45:32 2017
-// Update Count     : 16
+// Last Modified On : Tue Mar 14 08:07:34 2017
+// Update Count     : 17
 //
 
@@ -738,5 +738,5 @@
 				ObjectDecl *newobj = dynamic_cast< ObjectDecl* >( added );
 				ObjectDecl *oldobj = dynamic_cast< ObjectDecl* >( existing );
-				if ( ! newobj->get_storageClasses()[ DeclarationNode::Extern ] && ! oldobj->get_storageClasses()[ DeclarationNode::Extern ] ) {
+				if ( ! newobj->get_storageClasses().is_extern && ! oldobj->get_storageClasses().is_extern ) {
 					throw SemanticError( "duplicate object definition for ", added );
 				} // if
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/SymTab/Validate.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -323,5 +323,5 @@
 			ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i );
 			assert( obj );
-			obj->set_type( new EnumInstType( Type::Qualifiers( true, false, false, false, false ), enumDecl->get_name() ) );
+			obj->set_type( new EnumInstType( Type::Qualifiers( true, false, false, false, false, false ), enumDecl->get_name() ) );
 		} // for
 		Parent::visit( enumDecl );
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/SynTree/Type.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -25,6 +25,6 @@
   public:
 	struct Qualifiers {
-		Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ) {}
-		Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ) {}
+		Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ), isMutex( false ) {}
+		Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic, bool isMutex ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ), isMutex( isMutex ) {}
 
 		Qualifiers &operator&=( const Qualifiers &other );
@@ -45,4 +45,5 @@
 		bool isLvalue;
 		bool isAtomic;
+		bool isMutex;
 	};
 
@@ -511,4 +512,5 @@
 	isLvalue &= other.isLvalue;
 	isAtomic &= other.isAtomic;
+	isMutex &= other.isMutex;
 	return *this;
 }
@@ -520,4 +522,5 @@
 	isLvalue |= other.isLvalue;
 	isAtomic |= other.isAtomic;
+	isMutex |= other.isMutex;
 	return *this;
 }
@@ -528,4 +531,5 @@
 	if ( other.isRestrict ) isRestrict = 0;
 	if ( other.isAtomic ) isAtomic = 0;
+	if ( other.isMutex ) isMutex = 0;
 	return *this;
 }
Index: src/Tuples/TupleAssignment.cc
===================================================================
--- src/Tuples/TupleAssignment.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Tuples/TupleAssignment.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -199,5 +199,5 @@
 				Type * type = InitTweak::getPointerBase( castType );
 				assert( type );
-				type->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true);
+				type->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false);
 				type->set_isLvalue( true ); // xxx - might not need this
 				expr = new CastExpr( expr, castType );
Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/Tuples/TupleExpansion.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -305,5 +305,5 @@
 	Type * makeTupleType( const std::list< Expression * > & exprs ) {
 		// produce the TupleType which aggregates the types of the exprs
-		TupleType *tupleType = new TupleType( Type::Qualifiers(true, true, true, true, true) );
+		TupleType *tupleType = new TupleType( Type::Qualifiers(true, true, true, true, true, true) );
 		Type::Qualifiers &qualifiers = tupleType->get_qualifiers();
 		for ( Expression * expr : exprs ) {
Index: src/benchmark/CorCtxSwitch.c
===================================================================
--- src/benchmark/CorCtxSwitch.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/benchmark/CorCtxSwitch.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -1,5 +1,5 @@
 #include <fstream>
 #include <stdlib>
-#include <threads>
+#include <thread>
 
 #include <unistd.h>					// sysconf
@@ -24,5 +24,5 @@
 
 struct GreatSuspender {
-	coroutine c;
+	coroutine_desc c;
 };
 
Index: src/benchmark/ThrdCtxSwitch.c
===================================================================
--- src/benchmark/ThrdCtxSwitch.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/benchmark/ThrdCtxSwitch.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -1,5 +1,5 @@
 #include <fstream>
 #include <stdlib>
-#include <threads>
+#include <thread>
 
 #include <unistd.h>					// sysconf
Index: src/benchmark/bench.c
===================================================================
--- src/benchmark/bench.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/benchmark/bench.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -2,5 +2,5 @@
 #include <fstream>
 #include <stdlib>
-#include <threads>
+#include <thread>
 
 #include <unistd.h>					// sysconf
@@ -86,5 +86,5 @@
 //=======================================
 
-struct CoroutineDummy { coroutine c; };
+struct CoroutineDummy { coroutine_desc c; };
 DECL_COROUTINE(CoroutineDummy);
 void main(CoroutineDummy * this) {}
@@ -119,5 +119,5 @@
 struct CoroutineResume {
     int N;
-    coroutine c;
+    coroutine_desc c;
 };
 
@@ -150,5 +150,5 @@
 //=======================================
 
-struct ThreadDummy { thread t; };
+struct ThreadDummy { thread_desc t; };
 DECL_THREAD(ThreadDummy);
 void main(ThreadDummy * this) {}
@@ -180,5 +180,5 @@
     int N;
     long long result;
-    thread t;
+    thread_desc t;
 };
 
Index: src/benchmark/csv-data.c
===================================================================
--- src/benchmark/csv-data.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/benchmark/csv-data.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -1,5 +1,5 @@
 #include <fstream>
 #include <stdlib>
-#include <threads>
+#include <thread>
 
 extern "C" {
@@ -26,5 +26,5 @@
 
 struct GreatSuspender {
-	coroutine c;
+	coroutine_desc c;
 };
 
Index: src/examples/multicore.c
===================================================================
--- src/examples/multicore.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/examples/multicore.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -1,6 +1,6 @@
 #include <kernel>
-#include <threads>
+#include <thread>
 
-struct MyThread { thread t; };
+struct MyThread { thread_desc t; };
 
 DECL_THREAD(MyThread);
Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/Makefile.am	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -45,5 +45,5 @@
 # not all platforms support concurrency, add option do disable it
 if BUILD_CONCURRENCY
-headers += containers/vector concurrency/coroutines concurrency/threads concurrency/kernel concurrency/monitor
+headers += containers/vector concurrency/coroutine concurrency/thread concurrency/kernel concurrency/monitor
 endif
 
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/Makefile.in	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -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 concurrency/monitor
+@BUILD_CONCURRENCY_TRUE@am__append_3 = containers/vector concurrency/coroutine concurrency/thread concurrency/kernel concurrency/monitor
 
 # not all platforms support concurrency, add option do disable it
@@ -99,12 +99,12 @@
 am__libcfa_d_a_SOURCES_DIST = libcfa-prelude.c limits.c stdlib.c \
 	math.c iostream.c fstream.c iterator.c rational.c assert.c \
-	containers/vector.c concurrency/coroutines.c \
-	concurrency/threads.c concurrency/kernel.c \
+	containers/vector.c concurrency/coroutine.c \
+	concurrency/thread.c concurrency/kernel.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-coroutine.$(OBJEXT) \
+@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-thread.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-kernel.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_d_a-monitor.$(OBJEXT)
@@ -124,12 +124,12 @@
 am__libcfa_a_SOURCES_DIST = libcfa-prelude.c limits.c stdlib.c math.c \
 	iostream.c fstream.c iterator.c rational.c assert.c \
-	containers/vector.c concurrency/coroutines.c \
-	concurrency/threads.c concurrency/kernel.c \
+	containers/vector.c concurrency/coroutine.c \
+	concurrency/thread.c concurrency/kernel.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-coroutine.$(OBJEXT) \
+@BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-thread.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-kernel.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-monitor.$(OBJEXT)
@@ -175,5 +175,5 @@
 am__nobase_cfa_include_HEADERS_DIST = limits stdlib math iostream \
 	fstream iterator rational assert containers/vector \
-	concurrency/coroutines concurrency/threads concurrency/kernel \
+	concurrency/coroutine concurrency/thread concurrency/kernel \
 	concurrency/monitor ${shell echo stdhdr/*} \
 	concurrency/invoke.h
@@ -397,8 +397,8 @@
 	@$(MKDIR_P) concurrency/$(DEPDIR)
 	@: > concurrency/$(DEPDIR)/$(am__dirstamp)
-concurrency/libcfa_d_a-coroutines.$(OBJEXT):  \
+concurrency/libcfa_d_a-coroutine.$(OBJEXT):  \
 	concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
-concurrency/libcfa_d_a-threads.$(OBJEXT): concurrency/$(am__dirstamp) \
+concurrency/libcfa_d_a-thread.$(OBJEXT): concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
 concurrency/libcfa_d_a-kernel.$(OBJEXT): concurrency/$(am__dirstamp) \
@@ -417,8 +417,7 @@
 containers/libcfa_a-vector.$(OBJEXT): containers/$(am__dirstamp) \
 	containers/$(DEPDIR)/$(am__dirstamp)
-concurrency/libcfa_a-coroutines.$(OBJEXT):  \
-	concurrency/$(am__dirstamp) \
+concurrency/libcfa_a-coroutine.$(OBJEXT): concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
-concurrency/libcfa_a-threads.$(OBJEXT): concurrency/$(am__dirstamp) \
+concurrency/libcfa_a-thread.$(OBJEXT): concurrency/$(am__dirstamp) \
 	concurrency/$(DEPDIR)/$(am__dirstamp)
 concurrency/libcfa_a-kernel.$(OBJEXT): concurrency/$(am__dirstamp) \
@@ -436,14 +435,14 @@
 	-rm -f *.$(OBJEXT)
 	-rm -f concurrency/CtxSwitch-@MACHINE_TYPE@.$(OBJEXT)
-	-rm -f concurrency/libcfa_a-coroutines.$(OBJEXT)
+	-rm -f concurrency/libcfa_a-coroutine.$(OBJEXT)
 	-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_a-thread.$(OBJEXT)
+	-rm -f concurrency/libcfa_d_a-coroutine.$(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 concurrency/libcfa_d_a-thread.$(OBJEXT)
 	-rm -f containers/libcfa_a-vector.$(OBJEXT)
 	-rm -f containers/libcfa_d_a-vector.$(OBJEXT)
@@ -471,14 +470,14 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-coroutines.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-coroutine.Po@am__quote@
 @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_a-thread.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-coroutine.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@concurrency/$(DEPDIR)/libcfa_d_a-thread.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_a-vector.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_d_a-vector.Po@am__quote@
@@ -649,31 +648,31 @@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_d_a-vector.obj `if test -f 'containers/vector.c'; then $(CYGPATH_W) 'containers/vector.c'; else $(CYGPATH_W) '$(srcdir)/containers/vector.c'; fi`
 
-concurrency/libcfa_d_a-coroutines.o: concurrency/coroutines.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-coroutines.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo -c -o concurrency/libcfa_d_a-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_d_a-coroutines.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-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c
-
-concurrency/libcfa_d_a-coroutines.obj: concurrency/coroutines.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-coroutines.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo -c -o concurrency/libcfa_d_a-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_d_a-coroutines.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-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi`
-
-concurrency/libcfa_d_a-threads.o: concurrency/threads.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-threads.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo -c -o concurrency/libcfa_d_a-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_d_a-threads.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_d_a-threads.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-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c
-
-concurrency/libcfa_d_a-threads.obj: concurrency/threads.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-threads.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo -c -o concurrency/libcfa_d_a-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_d_a-threads.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_d_a-threads.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-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi`
+concurrency/libcfa_d_a-coroutine.o: concurrency/coroutine.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-coroutine.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Tpo -c -o concurrency/libcfa_d_a-coroutine.o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutine.c' object='concurrency/libcfa_d_a-coroutine.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-coroutine.o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c
+
+concurrency/libcfa_d_a-coroutine.obj: concurrency/coroutine.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-coroutine.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Tpo -c -o concurrency/libcfa_d_a-coroutine.obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutine.c' object='concurrency/libcfa_d_a-coroutine.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-coroutine.obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`
+
+concurrency/libcfa_d_a-thread.o: concurrency/thread.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-thread.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-thread.Tpo -c -o concurrency/libcfa_d_a-thread.o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-thread.Tpo concurrency/$(DEPDIR)/libcfa_d_a-thread.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/thread.c' object='concurrency/libcfa_d_a-thread.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-thread.o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c
+
+concurrency/libcfa_d_a-thread.obj: concurrency/thread.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-thread.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-thread.Tpo -c -o concurrency/libcfa_d_a-thread.obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-thread.Tpo concurrency/$(DEPDIR)/libcfa_d_a-thread.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/thread.c' object='concurrency/libcfa_d_a-thread.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-thread.obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`
 
 concurrency/libcfa_d_a-kernel.o: concurrency/kernel.c
@@ -845,31 +844,31 @@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_a-vector.obj `if test -f 'containers/vector.c'; then $(CYGPATH_W) 'containers/vector.c'; else $(CYGPATH_W) '$(srcdir)/containers/vector.c'; fi`
 
-concurrency/libcfa_a-coroutines.o: concurrency/coroutines.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutines.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo -c -o concurrency/libcfa_a-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_a-coroutines.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_a-coroutines.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-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c
-
-concurrency/libcfa_a-coroutines.obj: concurrency/coroutines.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutines.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo -c -o concurrency/libcfa_a-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_a-coroutines.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_a-coroutines.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-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi`
-
-concurrency/libcfa_a-threads.o: concurrency/threads.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-threads.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-threads.Tpo -c -o concurrency/libcfa_a-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_a-threads.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_a-threads.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-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c
-
-concurrency/libcfa_a-threads.obj: concurrency/threads.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-threads.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-threads.Tpo -c -o concurrency/libcfa_a-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_a-threads.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_a-threads.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-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi`
+concurrency/libcfa_a-coroutine.o: concurrency/coroutine.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutine.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutine.Tpo -c -o concurrency/libcfa_a-coroutine.o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutine.Tpo concurrency/$(DEPDIR)/libcfa_a-coroutine.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutine.c' object='concurrency/libcfa_a-coroutine.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-coroutine.o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c
+
+concurrency/libcfa_a-coroutine.obj: concurrency/coroutine.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutine.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutine.Tpo -c -o concurrency/libcfa_a-coroutine.obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutine.Tpo concurrency/$(DEPDIR)/libcfa_a-coroutine.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/coroutine.c' object='concurrency/libcfa_a-coroutine.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-coroutine.obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`
+
+concurrency/libcfa_a-thread.o: concurrency/thread.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-thread.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-thread.Tpo -c -o concurrency/libcfa_a-thread.o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-thread.Tpo concurrency/$(DEPDIR)/libcfa_a-thread.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/thread.c' object='concurrency/libcfa_a-thread.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-thread.o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c
+
+concurrency/libcfa_a-thread.obj: concurrency/thread.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-thread.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-thread.Tpo -c -o concurrency/libcfa_a-thread.obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-thread.Tpo concurrency/$(DEPDIR)/libcfa_a-thread.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='concurrency/thread.c' object='concurrency/libcfa_a-thread.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-thread.obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`
 
 concurrency/libcfa_a-kernel.o: concurrency/kernel.c
Index: src/libcfa/concurrency/coroutine
===================================================================
--- src/libcfa/concurrency/coroutine	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
+++ src/libcfa/concurrency/coroutine	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -0,0 +1,136 @@
+//                              - *- 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.
+//
+// coroutine --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Nov 28 12:27:26 2016
+// Last Modified By : Thierry Delisle
+// Last Modified On : Mon Nov 28 12:27:26 2016
+// Update Count     : 0
+//
+
+#ifndef COROUTINES_H
+#define COROUTINES_H
+
+#include "assert"
+#include "invoke.h"
+
+//-----------------------------------------------------------------------------
+// Coroutine trait
+// Anything that implements this trait can be resumed.
+// Anything that is resumed is a coroutine.
+trait is_coroutine(dtype T) {
+      void main(T * this);
+      coroutine_desc * get_coroutine(T * this);
+};
+
+#define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X* this) { return &this->c; } void main(X* this)
+
+//-----------------------------------------------------------------------------
+// Ctors and dtors
+void ?{}(coStack_t * this);
+void ?{}(coroutine_desc * this);
+void ?{}(coroutine_desc * this, const char * name);
+void ^?{}(coStack_t * this);
+void ^?{}(coroutine_desc * this);
+
+//-----------------------------------------------------------------------------
+// Public coroutine API
+static inline void suspend();
+
+forall(dtype T | is_coroutine(T))
+static inline void resume(T * cor);
+
+forall(dtype T | is_coroutine(T))
+void prime(T * cor);
+
+//-----------------------------------------------------------------------------
+// PRIVATE exposed because of inline
+
+// Start coroutine routines
+extern "C" {
+      forall(dtype T | is_coroutine(T))
+      void CtxInvokeCoroutine(T * this);
+
+      forall(dtype T | is_coroutine(T))
+      void CtxStart(T * this, void ( *invoke)(T *));
+}
+
+// Get current coroutine
+coroutine_desc * this_coroutine(void);
+
+// Private wrappers for context switch and stack creation
+extern void CoroutineCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
+extern void create_stack( coStack_t * this, unsigned int storageSize );
+
+// Suspend implementation inlined for performance
+static inline void suspend() {
+      coroutine_desc * src = this_coroutine();		// optimization
+
+	assertf( src->last != 0,
+		"Attempt to suspend coroutine \"%.256s\" (%p) that has never been resumed.\n"
+		"Possible cause is a suspend executed in a member called by a coroutine user rather than by the coroutine main.",
+		src->name, src );
+	assertf( src->last->state != Halted,
+		"Attempt by coroutine \"%.256s\" (%p) to suspend back to terminated coroutine \"%.256s\" (%p).\n"
+		"Possible cause is terminated coroutine's main routine has already returned.",
+		src->name, src, src->last->name, src->last );
+
+	CoroutineCtxSwitch( src, src->last );
+}
+
+// Resume implementation inlined for performance
+forall(dtype T | is_coroutine(T))
+static inline void resume(T * cor) {
+	coroutine_desc * src = this_coroutine();		// optimization
+	coroutine_desc * dst = get_coroutine(cor);
+
+      if( unlikely(!dst->stack.base) ) {
+		create_stack(&dst->stack, dst->stack.size);
+		CtxStart(cor, CtxInvokeCoroutine);
+	}
+
+      // not resuming self ?
+	if ( src != dst ) {
+		assertf( dst->state != Halted ,
+			"Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
+			"Possible cause is terminated coroutine's main routine has already returned.",
+			src->name, src, dst->name, dst );
+
+            // set last resumer
+		dst->last = src;
+	} // if
+
+      // always done for performance testing
+	CoroutineCtxSwitch( src, dst );
+}
+
+static inline void resume(coroutine_desc * dst) {
+	coroutine_desc * src = this_coroutine();		// optimization
+
+      // not resuming self ?
+	if ( src != dst ) {
+		assertf( dst->state != Halted ,
+			"Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
+			"Possible cause is terminated coroutine's main routine has already returned.",
+			src->name, src, dst->name, dst );
+
+            // set last resumer
+		dst->last = src;
+	} // if
+
+      // always done for performance testing
+	CoroutineCtxSwitch( src, dst );
+}
+
+#endif //COROUTINES_H
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/concurrency/coroutine.c
===================================================================
--- src/libcfa/concurrency/coroutine.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
+++ src/libcfa/concurrency/coroutine.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -0,0 +1,178 @@
+//                              -*- 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.
+//
+// coroutine.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Nov 28 12:27:26 2016
+// Last Modified By : Thierry Delisle
+// Last Modified On : Mon Nov 28 12:27:26 2016
+// Update Count     : 0
+//
+
+#include "coroutine"
+
+extern "C" {
+#include <stddef.h>
+#include <malloc.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+}
+
+#include "kernel"
+#include "libhdr.h"
+
+#define __CFA_INVOKE_PRIVATE__
+#include "invoke.h"
+
+extern thread_local processor * this_processor;
+
+//-----------------------------------------------------------------------------
+// Global state variables
+
+// minimum feasible stack size in bytes
+#define MinStackSize 1000
+static size_t pageSize = 0;				// architecture pagesize HACK, should go in proper runtime singleton
+
+//-----------------------------------------------------------------------------
+// Coroutine ctors and dtors
+void ?{}(coStack_t* this) {
+	this->size		= 10240;	// size of stack
+	this->storage	= NULL;	// pointer to stack
+	this->limit		= NULL;	// stack grows towards stack limit
+	this->base		= NULL;	// base of stack
+	this->context	= NULL;	// address of cfa_context_t
+	this->top		= NULL;	// address of top of storage
+	this->userStack	= false;	
+}
+
+void ?{}(coStack_t* this, size_t size) {
+	this{};
+	this->size = size;
+
+	create_stack(this, this->size);
+}
+
+void ?{}(coroutine_desc* this) {
+	this{ "Anonymous Coroutine" };
+}
+
+void ?{}(coroutine_desc* this, const char * name) {
+	this->name = name;
+	this->errno_ = 0;
+	this->state = Start;
+	this->starter = NULL;
+	this->last = NULL;
+}
+
+void ?{}(coroutine_desc* this, size_t size) {
+	this{};
+	(&this->stack){size};
+}
+
+void ^?{}(coStack_t* this) {
+	if ( ! this->userStack ) {
+		LIB_DEBUG_DO(
+			if ( mprotect( this->storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) {
+				abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", this, errno, strerror( errno ) );
+			}
+		);
+		free( this->storage );
+	}
+}
+
+void ^?{}(coroutine_desc* this) {}
+
+// Part of the Public API
+// Not inline since only ever called once per coroutine
+forall(dtype T | is_coroutine(T))
+void prime(T* cor) {
+	coroutine_desc* this = get_coroutine(cor);
+	assert(this->state == Start);
+
+	this->state = Primed;
+	resume(cor);
+}
+
+// Wrapper for co
+void CoroutineCtxSwitch(coroutine_desc* src, coroutine_desc* dst) {
+	// THREAD_GETMEM( This )->disableInterrupts();
+
+	// set state of current coroutine to inactive
+	src->state = Inactive;
+
+	// set new coroutine that task is executing
+	this_processor->current_coroutine = dst;
+
+	// context switch to specified coroutine
+	CtxSwitch( src->stack.context, dst->stack.context );
+	// when CtxSwitch returns we are back in the src coroutine		
+
+	// set state of new coroutine to active
+	src->state = Active;
+
+	// THREAD_GETMEM( This )->enableInterrupts();
+} //ctxSwitchDirect
+
+void create_stack( coStack_t* this, unsigned int storageSize ) {
+	//TEMP HACK do this on proper kernel startup
+	if(pageSize == 0ul) pageSize = sysconf( _SC_PAGESIZE );
+
+	size_t cxtSize = libCeiling( sizeof(machine_context_t), 8 ); // minimum alignment
+
+	if ( (intptr_t)this->storage == 0 ) {
+		this->userStack = false;
+		this->size = libCeiling( storageSize, 16 );
+		// use malloc/memalign because "new" raises an exception for out-of-memory
+		
+		// assume malloc has 8 byte alignment so add 8 to allow rounding up to 16 byte alignment
+		LIB_DEBUG_DO( this->storage = memalign( pageSize, cxtSize + this->size + pageSize ) );
+		LIB_NO_DEBUG_DO( this->storage = malloc( cxtSize + this->size + 8 ) );
+
+		LIB_DEBUG_DO(
+			if ( mprotect( this->storage, pageSize, PROT_NONE ) == -1 ) {
+				abortf( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) );
+			} // if
+		);
+
+		if ( (intptr_t)this->storage == 0 ) {
+			abortf( "Attempt to allocate %d bytes of storage for coroutine or task execution-state but insufficient memory available.", this->size );
+		} // if
+
+		LIB_DEBUG_DO( this->limit = (char *)this->storage + pageSize );
+		LIB_NO_DEBUG_DO( this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ) ); // minimum alignment
+
+	} else {
+		assertf( ((size_t)this->storage & (libAlign() - 1)) != 0ul, "Stack storage %p for task/coroutine must be aligned on %d byte boundary.", this->storage, (int)libAlign() );
+		this->userStack = true;
+		this->size = storageSize - cxtSize;
+
+		if ( this->size % 16 != 0u ) this->size -= 8;
+
+		this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ); // minimum alignment
+	} // if
+	assertf( this->size >= MinStackSize, "Stack size %d provides less than minimum of %d bytes for a stack.", this->size, MinStackSize );
+
+	this->base = (char *)this->limit + this->size;
+	this->context = this->base;
+	this->top = (char *)this->context + cxtSize;
+}
+
+// We need to call suspend from invoke.c, so we expose this wrapper that
+// is not inline (We can't inline Cforall in C)
+extern "C" {
+	void __suspend_internal(void) {
+		suspend();
+	}
+}
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: c/libcfa/concurrency/coroutines
===================================================================
--- src/libcfa/concurrency/coroutines	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ 	(revision )
@@ -1,136 +1,0 @@
-//                              - *- 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.
-//
-// coroutines --
-//
-// Author           : Thierry Delisle
-// Created On       : Mon Nov 28 12:27:26 2016
-// Last Modified By : Thierry Delisle
-// Last Modified On : Mon Nov 28 12:27:26 2016
-// Update Count     : 0
-//
-
-#ifndef COROUTINES_H
-#define COROUTINES_H
-
-#include "assert"
-#include "invoke.h"
-
-//-----------------------------------------------------------------------------
-// Coroutine trait
-// Anything that implements this trait can be resumed.
-// Anything that is resumed is a coroutine.
-trait is_coroutine(dtype T) {
-      void main(T * this);
-      coroutine * get_coroutine(T * this);
-};
-
-#define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this)
-
-//-----------------------------------------------------------------------------
-// Ctors and dtors
-void ?{}(coStack_t * this);
-void ?{}(coroutine * this);
-void ?{}(coroutine * this, const char * name);
-void ^?{}(coStack_t * this);
-void ^?{}(coroutine * this);
-
-//-----------------------------------------------------------------------------
-// Public coroutine API
-static inline void suspend();
-
-forall(dtype T | is_coroutine(T))
-static inline void resume(T * cor);
-
-forall(dtype T | is_coroutine(T))
-void prime(T * cor);
-
-//-----------------------------------------------------------------------------
-// PRIVATE exposed because of inline
-
-// Start coroutine routines
-extern "C" {
-      forall(dtype T | is_coroutine(T))
-      void CtxInvokeCoroutine(T * this);
-
-      forall(dtype T | is_coroutine(T))
-      void CtxStart(T * this, void ( *invoke)(T *));
-}
-
-// Get current coroutine
-coroutine * this_coroutine(void);
-
-// Private wrappers for context switch and stack creation
-extern void CoroutineCtxSwitch(coroutine * src, coroutine * dst);
-extern void create_stack( coStack_t * this, unsigned int storageSize );
-
-// Suspend implementation inlined for performance
-static inline void suspend() {
-      coroutine * src = this_coroutine();		// optimization
-
-	assertf( src->last != 0,
-		"Attempt to suspend coroutine \"%.256s\" (%p) that has never been resumed.\n"
-		"Possible cause is a suspend executed in a member called by a coroutine user rather than by the coroutine main.",
-		src->name, src );
-	assertf( src->last->state != Halted,
-		"Attempt by coroutine \"%.256s\" (%p) to suspend back to terminated coroutine \"%.256s\" (%p).\n"
-		"Possible cause is terminated coroutine's main routine has already returned.",
-		src->name, src, src->last->name, src->last );
-
-	CoroutineCtxSwitch( src, src->last );
-}
-
-// Resume implementation inlined for performance
-forall(dtype T | is_coroutine(T))
-static inline void resume(T * cor) {
-	coroutine * src = this_coroutine();		// optimization
-	coroutine * dst = get_coroutine(cor);
-
-      if( unlikely(!dst->stack.base) ) {
-		create_stack(&dst->stack, dst->stack.size);
-		CtxStart(cor, CtxInvokeCoroutine);
-	}
-
-      // not resuming self ?
-	if ( src != dst ) {
-		assertf( dst->state != Halted ,
-			"Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
-			"Possible cause is terminated coroutine's main routine has already returned.",
-			src->name, src, dst->name, dst );
-
-            // set last resumer
-		dst->last = src;
-	} // if
-
-      // always done for performance testing
-	CoroutineCtxSwitch( src, dst );
-}
-
-static inline void resume(coroutine * dst) {
-	coroutine * src = this_coroutine();		// optimization
-
-      // not resuming self ?
-	if ( src != dst ) {
-		assertf( dst->state != Halted ,
-			"Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
-			"Possible cause is terminated coroutine's main routine has already returned.",
-			src->name, src, dst->name, dst );
-
-            // set last resumer
-		dst->last = src;
-	} // if
-
-      // always done for performance testing
-	CoroutineCtxSwitch( src, dst );
-}
-
-#endif //COROUTINES_H
-
-// Local Variables: //
-// mode: c //
-// tab-width: 4 //
-// End: //
Index: c/libcfa/concurrency/coroutines.c
===================================================================
--- src/libcfa/concurrency/coroutines.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ 	(revision )
@@ -1,178 +1,0 @@
-//                              -*- 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.
-//
-// coroutines.c --
-//
-// Author           : Thierry Delisle
-// Created On       : Mon Nov 28 12:27:26 2016
-// Last Modified By : Thierry Delisle
-// Last Modified On : Mon Nov 28 12:27:26 2016
-// Update Count     : 0
-//
-
-#include "coroutines"
-
-extern "C" {
-#include <stddef.h>
-#include <malloc.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
-}
-
-#include "kernel"
-#include "libhdr.h"
-
-#define __CFA_INVOKE_PRIVATE__
-#include "invoke.h"
-
-extern processor * get_this_processor();
-
-//-----------------------------------------------------------------------------
-// Global state variables
-
-// minimum feasible stack size in bytes
-#define MinStackSize 1000
-static size_t pageSize = 0;				// architecture pagesize HACK, should go in proper runtime singleton
-
-//-----------------------------------------------------------------------------
-// Coroutine ctors and dtors
-void ?{}(coStack_t* this) {
-	this->size		= 10240;	// size of stack
-	this->storage	= NULL;	// pointer to stack
-	this->limit		= NULL;	// stack grows towards stack limit
-	this->base		= NULL;	// base of stack
-	this->context	= NULL;	// address of cfa_context_t
-	this->top		= NULL;	// address of top of storage
-	this->userStack	= false;	
-}
-
-void ?{}(coStack_t* this, size_t size) {
-	this{};
-	this->size = size;
-
-	create_stack(this, this->size);
-}
-
-void ?{}(coroutine* this) {
-	this{ "Anonymous Coroutine" };
-}
-
-void ?{}(coroutine* this, const char * name) {
-	this->name = name;
-	this->errno_ = 0;
-	this->state = Start;
-	this->starter = NULL;
-	this->last = NULL;
-}
-
-void ?{}(coroutine* this, size_t size) {
-	this{};
-	(&this->stack){size};
-}
-
-void ^?{}(coStack_t* this) {
-	if ( ! this->userStack ) {
-		LIB_DEBUG_DO(
-			if ( mprotect( this->storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) {
-				abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", this, errno, strerror( errno ) );
-			}
-		);
-		free( this->storage );
-	}
-}
-
-void ^?{}(coroutine* this) {}
-
-// Part of the Public API
-// Not inline since only ever called once per coroutine
-forall(dtype T | is_coroutine(T))
-void prime(T* cor) {
-	coroutine* this = get_coroutine(cor);
-	assert(this->state == Start);
-
-	this->state = Primed;
-	resume(cor);
-}
-
-// Wrapper for co
-void CoroutineCtxSwitch(coroutine* src, coroutine* dst) {
-	// THREAD_GETMEM( This )->disableInterrupts();
-
-	// set state of current coroutine to inactive
-	src->state = Inactive;
-
-	// set new coroutine that task is executing
-	get_this_processor()->current_coroutine = dst;			
-
-	// context switch to specified coroutine
-	CtxSwitch( src->stack.context, dst->stack.context );
-	// when CtxSwitch returns we are back in the src coroutine		
-
-	// set state of new coroutine to active
-	src->state = Active;
-
-	// THREAD_GETMEM( This )->enableInterrupts();
-} //ctxSwitchDirect
-
-void create_stack( coStack_t* this, unsigned int storageSize ) {
-	//TEMP HACK do this on proper kernel startup
-	if(pageSize == 0ul) pageSize = sysconf( _SC_PAGESIZE );
-
-	size_t cxtSize = libCeiling( sizeof(machine_context_t), 8 ); // minimum alignment
-
-	if ( (intptr_t)this->storage == 0 ) {
-		this->userStack = false;
-		this->size = libCeiling( storageSize, 16 );
-		// use malloc/memalign because "new" raises an exception for out-of-memory
-		
-		// assume malloc has 8 byte alignment so add 8 to allow rounding up to 16 byte alignment
-		LIB_DEBUG_DO( this->storage = memalign( pageSize, cxtSize + this->size + pageSize ) );
-		LIB_NO_DEBUG_DO( this->storage = malloc( cxtSize + this->size + 8 ) );
-
-		LIB_DEBUG_DO(
-			if ( mprotect( this->storage, pageSize, PROT_NONE ) == -1 ) {
-				abortf( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) );
-			} // if
-		);
-
-		if ( (intptr_t)this->storage == 0 ) {
-			abortf( "Attempt to allocate %d bytes of storage for coroutine or task execution-state but insufficient memory available.", this->size );
-		} // if
-
-		LIB_DEBUG_DO( this->limit = (char *)this->storage + pageSize );
-		LIB_NO_DEBUG_DO( this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ) ); // minimum alignment
-
-	} else {
-		assertf( ((size_t)this->storage & (libAlign() - 1)) != 0ul, "Stack storage %p for task/coroutine must be aligned on %d byte boundary.", this->storage, (int)libAlign() );
-		this->userStack = true;
-		this->size = storageSize - cxtSize;
-
-		if ( this->size % 16 != 0u ) this->size -= 8;
-
-		this->limit = (char *)libCeiling( (unsigned long)this->storage, 16 ); // minimum alignment
-	} // if
-	assertf( this->size >= MinStackSize, "Stack size %d provides less than minimum of %d bytes for a stack.", this->size, MinStackSize );
-
-	this->base = (char *)this->limit + this->size;
-	this->context = this->base;
-	this->top = (char *)this->context + cxtSize;
-}
-
-// We need to call suspend from invoke.c, so we expose this wrapper that
-// is not inline (We can't inline Cforall in C)
-extern "C" {
-	void __suspend_internal(void) {
-		suspend();
-	}
-}
-
-// Local Variables: //
-// mode: c //
-// tab-width: 4 //
-// End: //
Index: src/libcfa/concurrency/invoke.c
===================================================================
--- src/libcfa/concurrency/invoke.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/invoke.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -29,14 +29,14 @@
 
 extern void __suspend_internal(void);
-extern void __thread_signal_termination(struct thread*);
+extern void __thread_signal_termination(struct thread_desc*);
 
 void CtxInvokeCoroutine(
       void (*main)(void *), 
-      struct coroutine *(*get_coroutine)(void *), 
+      struct coroutine_desc *(*get_coroutine)(void *), 
       void *this
 ) {
       // LIB_DEBUG_PRINTF("Invoke Coroutine : Received %p (main %p, get_c %p)\n", this, main, get_coroutine);
 
-      struct coroutine* cor = get_coroutine( this );
+      struct coroutine_desc* cor = get_coroutine( this );
 
       if(cor->state == Primed) {
@@ -57,11 +57,11 @@
 void CtxInvokeThread(
       void (*main)(void *), 
-      struct thread *(*get_thread)(void *), 
+      struct thread_desc *(*get_thread)(void *), 
       void *this
 ) {
       __suspend_internal();
 
-      struct thread* thrd = get_thread( this );
-      struct coroutine* cor = &thrd->c;
+      struct thread_desc* thrd = get_thread( this );
+      struct coroutine_desc* cor = &thrd->c;
       cor->state = Active;
 
@@ -79,5 +79,5 @@
 void CtxStart(
       void (*main)(void *), 
-      struct coroutine *(*get_coroutine)(void *), 
+      struct coroutine_desc *(*get_coroutine)(void *), 
       void *this, 
       void (*invoke)(void *)
Index: src/libcfa/concurrency/invoke.h
===================================================================
--- src/libcfa/concurrency/invoke.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/invoke.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -35,6 +35,6 @@
 
       struct simple_thread_list {
-            struct thread * head;
-            struct thread ** tail;
+            struct thread_desc * head;
+            struct thread_desc ** tail;
       };
 
@@ -48,6 +48,6 @@
       extern "Cforall" {
             void ?{}( struct simple_thread_list * );
-            void append( struct simple_thread_list *, struct thread * );
-            struct thread * pop_head( struct simple_thread_list * );
+            void append( struct simple_thread_list *, struct thread_desc * );
+            struct thread_desc * pop_head( struct simple_thread_list * );
 
             void ?{}(spinlock * this);
@@ -71,17 +71,17 @@
       enum coroutine_state { Halted, Start, Inactive, Active, Primed };
 
-      struct coroutine {
+      struct coroutine_desc {
             struct coStack_t stack;
             const char *name;			      // textual name for coroutine/task, initialized by uC++ generated code
             int errno_;				      // copy of global UNIX variable errno
             enum coroutine_state state;	      // current execution status for coroutine
-            struct coroutine *starter;	      // first coroutine to resume this one
-            struct coroutine *last;		      // last coroutine to resume this one
+            struct coroutine_desc *starter;	      // first coroutine to resume this one
+            struct coroutine_desc *last;		      // last coroutine to resume this one
       };
 
-      struct thread {
-            struct coroutine c;                 // coroutine body used to store context
+      struct thread_desc {
+            struct coroutine_desc c;                 // coroutine body used to store context
             struct signal_once terminated;      // indicate if execuation state is not halted
-            struct thread * next;               // instrusive link field for threads
+            struct thread_desc * next;               // instrusive link field for threads
       };
 
Index: src/libcfa/concurrency/kernel
===================================================================
--- src/libcfa/concurrency/kernel	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/kernel	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -6,5 +6,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// threads --
+// kernel --
 //
 // Author           : Thierry Delisle
@@ -49,5 +49,5 @@
 struct FinishAction {
 	FinishOpCode action_code;
-	thread * thrd;
+	thread_desc * thrd;
 	spinlock * lock;
 };
@@ -62,6 +62,6 @@
 	struct processorCtx_t * runner;
 	cluster * cltr;
-	coroutine * current_coroutine;
-	thread * current_thread;
+	coroutine_desc * current_coroutine;
+	thread_desc * current_thread;
 	pthread_t kernel_thread;
 	
Index: src/libcfa/concurrency/kernel.c
===================================================================
--- src/libcfa/concurrency/kernel.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/kernel.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -43,10 +43,10 @@
 KERNEL_STORAGE(cluster, systemCluster);
 KERNEL_STORAGE(processor, systemProcessor);
-KERNEL_STORAGE(thread, mainThread);
+KERNEL_STORAGE(thread_desc, mainThread);
 KERNEL_STORAGE(machine_context_t, mainThread_context);
 
 cluster * systemCluster;
 processor * systemProcessor;
-thread * mainThread;
+thread_desc * mainThread;
 
 //-----------------------------------------------------------------------------
@@ -55,13 +55,9 @@
 thread_local processor * this_processor;
 
-processor * get_this_processor() {
-	return this_processor;
-}
-
-coroutine * this_coroutine(void) {
+coroutine_desc * this_coroutine(void) {
 	return this_processor->current_coroutine;
 }
 
-thread * this_thread(void) {
+thread_desc * this_thread(void) {
 	return this_processor->current_thread;
 }
@@ -103,5 +99,5 @@
 }
 
-void ?{}( coroutine * this, current_stack_info_t * info) {
+void ?{}( coroutine_desc * this, current_stack_info_t * info) {
 	(&this->stack){ info };	
 	this->name = "Main Thread";
@@ -110,5 +106,5 @@
 }
 
-void ?{}( thread * this, current_stack_info_t * info) {
+void ?{}( thread_desc * this, current_stack_info_t * info) {
 	(&this->c){ info };
 }
@@ -179,5 +175,5 @@
 	LIB_DEBUG_PRINTF("Kernel : core %p starting\n", this);
 
-	thread * readyThread = NULL;
+	thread_desc * readyThread = NULL;
 	for( unsigned int spin_count = 0; ! this->is_terminated; spin_count++ ) 
 	{
@@ -206,7 +202,7 @@
 // runThread runs a thread by context switching 
 // from the processor coroutine to the target thread 
-void runThread(processor * this, thread * dst) {
-	coroutine * proc_cor = get_coroutine(this->runner);
-	coroutine * thrd_cor = get_coroutine(dst);
+void runThread(processor * this, thread_desc * dst) {
+	coroutine_desc * proc_cor = get_coroutine(this->runner);
+	coroutine_desc * thrd_cor = get_coroutine(dst);
 	
 	//Reset the terminating actions here
@@ -297,5 +293,5 @@
 //-----------------------------------------------------------------------------
 // Scheduler routines
-void ScheduleThread( thread * thrd ) {
+void ScheduleThread( thread_desc * thrd ) {
 	assertf( thrd->next == NULL, "Expected null got %p", thrd->next );
 	
@@ -305,7 +301,7 @@
 }
 
-thread * nextThread(cluster * this) {
+thread_desc * nextThread(cluster * this) {
 	lock( &this->lock );
-	thread * head = pop_head( &this->ready_queue );
+	thread_desc * head = pop_head( &this->ready_queue );
 	unlock( &this->lock );
 	return head;
@@ -317,19 +313,19 @@
 
 void ScheduleInternal( spinlock * lock ) {
-	get_this_processor()->finish.action_code = Release;
-	get_this_processor()->finish.lock = lock;
+	this_processor->finish.action_code = Release;
+	this_processor->finish.lock = lock;
 	suspend();
 }
 
-void ScheduleInternal( thread * thrd ) {
-	get_this_processor()->finish.action_code = Schedule;
-	get_this_processor()->finish.thrd = thrd;
+void ScheduleInternal( thread_desc * thrd ) {
+	this_processor->finish.action_code = Schedule;
+	this_processor->finish.thrd = thrd;
 	suspend();
 }
 
-void ScheduleInternal( spinlock * lock, thread * thrd ) {
-	get_this_processor()->finish.action_code = Release_Schedule;
-	get_this_processor()->finish.lock = lock;
-	get_this_processor()->finish.thrd = thrd;
+void ScheduleInternal( spinlock * lock, thread_desc * thrd ) {
+	this_processor->finish.action_code = Release_Schedule;
+	this_processor->finish.lock = lock;
+	this_processor->finish.thrd = thrd;
 	suspend();
 }
@@ -343,5 +339,5 @@
 	// SKULLDUGGERY: the mainThread steals the process main thread 
 	// which will then be scheduled by the systemProcessor normally
-	mainThread = (thread *)&mainThread_storage;
+	mainThread = (thread_desc *)&mainThread_storage;
 	current_stack_info_t info;
 	mainThread{ &info };
@@ -440,5 +436,5 @@
 		this->condition = true;
 
-		thread * it;
+		thread_desc * it;
 		while( it = pop_head( &this->blocked) ) {
 			ScheduleThread( it );
@@ -455,5 +451,5 @@
 }
 
-void append( simple_thread_list * this, thread * t ) {
+void append( simple_thread_list * this, thread_desc * t ) {
 	assert(this->tail != NULL);
 	*this->tail = t;
@@ -461,6 +457,6 @@
 }
 
-thread * pop_head( simple_thread_list * this ) {
-	thread * head = this->head;
+thread_desc * pop_head( simple_thread_list * this ) {
+	thread_desc * head = this->head;
 	if( head ) {
 		this->head = head->next;
Index: src/libcfa/concurrency/kernel_private.h
===================================================================
--- src/libcfa/concurrency/kernel_private.h	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/kernel_private.h	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -6,5 +6,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// threads --
+// kernel_private.h --
 //
 // Author           : Thierry Delisle
@@ -19,15 +19,15 @@
 
 #include "kernel"
-#include "threads"
+#include "thread"
 
 //-----------------------------------------------------------------------------
 // Scheduler
-void ScheduleThread( thread * );
-thread * nextThread(cluster * this);
+void ScheduleThread( thread_desc * );
+thread_desc * nextThread(cluster * this);
 
 void ScheduleInternal();
 void ScheduleInternal(spinlock * lock);
-void ScheduleInternal(thread * thrd);
-void ScheduleInternal(spinlock * lock, thread * thrd);
+void ScheduleInternal(thread_desc * thrd);
+void ScheduleInternal(spinlock * lock, thread_desc * thrd);
 
 //-----------------------------------------------------------------------------
@@ -35,5 +35,5 @@
 struct processorCtx_t {
 	processor * proc;
-	coroutine c;
+	coroutine_desc c;
 };
 
@@ -42,5 +42,5 @@
 void main(processorCtx_t *);
 void start(processor * this);
-void runThread(processor * this, thread * dst);
+void runThread(processor * this, thread_desc * dst);
 void finishRunning(processor * this);
 void spin(processor * this, unsigned int * spin_count);
@@ -53,5 +53,5 @@
 }
 
-extern void ThreadCtxSwitch(coroutine * src, coroutine * dst);
+extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
 
 #endif //KERNEL_PRIVATE_H
Index: src/libcfa/concurrency/monitor
===================================================================
--- src/libcfa/concurrency/monitor	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/monitor	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -22,12 +22,12 @@
 #include "stdlib"
 
-struct __monitor_t {
+struct monitor_desc {
 	spinlock lock;
-	thread * owner;
+	thread_desc * owner;
 	simple_thread_list entry_queue;
 	unsigned int recursion;
 };
 
-static inline void ?{}(__monitor_t * this) {
+static inline void ?{}(monitor_desc * this) {
 	this->owner = 0;
 	this->recursion = 0;
@@ -35,21 +35,21 @@
 
 //Basic entering routine
-void enter(__monitor_t *);
-void leave(__monitor_t *);
+void enter(monitor_desc *);
+void leave(monitor_desc *);
 
 //Array entering routine
-void enter(__monitor_t **, int count);
-void leave(__monitor_t **, int count);
+void enter(monitor_desc **, int count);
+void leave(monitor_desc **, int count);
 
 struct monitor_guard_t {
-	__monitor_t ** m;
+	monitor_desc ** m;
 	int count;
 };
 
-static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) {
+static inline int ?<?(monitor_desc* lhs, monitor_desc* rhs) {
 	return ((intptr_t)lhs) < ((intptr_t)rhs);
 }
 
-static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) {
+static inline void ?{}( monitor_guard_t * this, monitor_desc ** m ) {
 	this->m = m;
 	this->count = 1;
@@ -57,5 +57,5 @@
 }
 
-static inline void ?{}( monitor_guard_t * this, __monitor_t ** m, int count ) {
+static inline void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) {
 	this->m = m;
 	this->count = count;
Index: src/libcfa/concurrency/monitor.c
===================================================================
--- src/libcfa/concurrency/monitor.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/libcfa/concurrency/monitor.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -6,5 +6,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// __monitor_t.c --
+// monitor_desc.c --
 //
 // Author           : Thierry Delisle
@@ -19,7 +19,7 @@
 #include "kernel_private.h"
 
-void enter(__monitor_t * this) {
+void enter(monitor_desc * this) {
 	lock( &this->lock );
-	thread * thrd = this_thread();
+	thread_desc * thrd = this_thread();
 
 	if( !this->owner ) {
@@ -45,8 +45,8 @@
 }
 
-void leave(__monitor_t * this) {
+void leave(monitor_desc * this) {
 	lock( &this->lock );
 
-	thread * thrd = this_thread();
+	thread_desc * thrd = this_thread();
 	assert( thrd == this->owner );
 
@@ -55,5 +55,5 @@
 
 	//If we left the last level of recursion it means we are changing who owns the monitor
-	thread * new_owner = 0;
+	thread_desc * new_owner = 0;
 	if( this->recursion == 0) {
 		//Get the next thread in the list
@@ -72,5 +72,5 @@
 }
 
-void enter(__monitor_t ** monitors, int count) {
+void enter(monitor_desc ** monitors, int count) {
 	for(int i = 0; i < count; i++) {
 		// printf("%d\n", i);
@@ -79,5 +79,5 @@
 }
 
-void leave(__monitor_t ** monitors, int count) {
+void leave(monitor_desc ** monitors, int count) {
 	for(int i = count - 1; i >= 0; i--) {
 		// printf("%d\n", i);
Index: src/libcfa/concurrency/thread
===================================================================
--- src/libcfa/concurrency/thread	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
+++ src/libcfa/concurrency/thread	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -0,0 +1,76 @@
+//                              -*- 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.
+//
+// thread --
+//
+// Author           : Thierry Delisle
+// Created On       : Tue Jan 17 12:27:26 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#ifndef THREADS_H
+#define THREADS_H
+
+#include "assert"
+#include "invoke.h"
+
+#include "coroutine"
+
+//-----------------------------------------------------------------------------
+// Coroutine trait
+// Anything that implements this trait can be resumed.
+// Anything that is resumed is a coroutine.
+trait is_thread(dtype T) {
+      void main(T* this);
+      thread_desc* get_thread(T* this);
+};
+
+#define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->t; } void main(X* this)
+
+forall( dtype T | is_thread(T) )
+static inline coroutine_desc* get_coroutine(T* this) {
+	return &get_thread(this)->c;
+}
+
+static inline coroutine_desc* get_coroutine(thread_desc* this) {
+	return &this->c;
+}
+
+thread_desc * this_thread(void);
+
+//-----------------------------------------------------------------------------
+// Ctors and dtors
+void ?{}(thread_desc* this);
+void ^?{}(thread_desc* this);
+
+//-----------------------------------------------------------------------------
+// thread runner
+// Structure that actually start and stop threads
+forall( dtype T | sized(T) | is_thread(T) )
+struct scoped {
+	T handle;
+};
+
+forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
+void ?{}( scoped(T)* this );
+
+forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
+void ?{}( scoped(T)* this, P params );
+
+forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
+void ^?{}( scoped(T)* this );
+
+void yield();
+
+#endif //THREADS_H
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/concurrency/thread.c
===================================================================
--- src/libcfa/concurrency/thread.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
+++ src/libcfa/concurrency/thread.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -0,0 +1,131 @@
+//                              -*- 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.
+//
+// thread.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Tue Jan 17 12:27:26 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#include "thread"
+
+#include "kernel_private.h"
+#include "libhdr.h"
+
+#define __CFA_INVOKE_PRIVATE__
+#include "invoke.h"
+
+extern "C" {
+	#include <fenv.h>
+	#include <stddef.h>
+}
+
+extern thread_local processor * this_processor;
+
+//-----------------------------------------------------------------------------
+// Forward declarations
+forall( dtype T | is_thread(T) )
+void start( T* this );
+
+forall( dtype T | is_thread(T) )
+void stop( T* this );
+
+//-----------------------------------------------------------------------------
+// Thread ctors and dtors
+
+void ?{}(thread_desc* this) {
+	(&this->c){};
+	this->c.name = "Anonymous Coroutine";
+	(&this->terminated){};
+	this->next = NULL;
+}
+
+void ^?{}(thread_desc* this) {
+	^(&this->c){};
+}
+
+forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
+void ?{}( scoped(T)* this ) {
+	(&this->handle){};
+	start(&this->handle);
+}
+
+forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
+void ?{}( scoped(T)* this, P params ) {
+	(&this->handle){ params };
+	start(&this->handle);
+}
+
+forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
+void ^?{}( scoped(T)* this ) {
+	stop(&this->handle);
+	^(&this->handle){};
+}
+
+//-----------------------------------------------------------------------------
+// Starting and stopping threads
+forall( dtype T | is_thread(T) )
+void start( T* this ) {
+	coroutine_desc* thrd_c = get_coroutine(this);
+	thread_desc*  thrd_h = get_thread   (this);
+	thrd_c->last = this_coroutine();
+	this_processor->current_coroutine = thrd_c;
+
+	LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
+
+	create_stack(&thrd_c->stack, thrd_c->stack.size);
+	CtxStart(this, CtxInvokeThread);
+	CtxSwitch( thrd_c->last->stack.context, thrd_c->stack.context );
+
+	ScheduleThread(thrd_h);
+}
+
+forall( dtype T | is_thread(T) )
+void stop( T* this ) {
+	wait( & get_thread(this)->terminated );	
+}
+
+void yield( void ) {
+	ScheduleInternal( this_processor->current_thread );
+}
+
+void ThreadCtxSwitch(coroutine_desc* src, coroutine_desc* dst) {
+	// set state of current coroutine to inactive
+	src->state = Inactive;
+	dst->state = Active;
+
+	//update the last resumer
+	dst->last = src;
+
+	// set new coroutine that the processor is executing
+	// and context switch to it
+	this_processor->current_coroutine = dst;
+	CtxSwitch( src->stack.context, dst->stack.context );
+	this_processor->current_coroutine = src;
+
+	// set state of new coroutine to active
+	dst->state = Inactive;
+	src->state = Active;
+}
+
+// C Helper to signal the termination of a thread_desc
+// Used in invoke.c
+extern "C" {
+	void __thread_signal_termination( thread_desc * this ) {
+		this->c.state = Halted;
+		LIB_DEBUG_PRINTF("Thread end : %p\n", this);
+		signal( &this->terminated );	
+	}
+}
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: c/libcfa/concurrency/threads
===================================================================
--- src/libcfa/concurrency/threads	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ 	(revision )
@@ -1,76 +1,0 @@
-//                              -*- 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.
-//
-// threads --
-//
-// Author           : Thierry Delisle
-// Created On       : Tue Jan 17 12:27:26 2017
-// Last Modified By : Thierry Delisle
-// Last Modified On : --
-// Update Count     : 0
-//
-
-#ifndef THREADS_H
-#define THREADS_H
-
-#include "assert"
-#include "invoke.h"
-
-#include "coroutines"
-
-//-----------------------------------------------------------------------------
-// Coroutine trait
-// Anything that implements this trait can be resumed.
-// Anything that is resumed is a coroutine.
-trait is_thread(dtype T) {
-      void main(T* this);
-      thread* get_thread(T* this);
-};
-
-#define DECL_THREAD(X) thread* get_thread(X* this) { return &this->t; } void main(X* this)
-
-forall( dtype T | is_thread(T) )
-static inline coroutine* get_coroutine(T* this) {
-	return &get_thread(this)->c;
-}
-
-static inline coroutine* get_coroutine(thread* this) {
-	return &this->c;
-}
-
-thread * this_thread(void);
-
-//-----------------------------------------------------------------------------
-// Ctors and dtors
-void ?{}(thread* this);
-void ^?{}(thread* this);
-
-//-----------------------------------------------------------------------------
-// thread runner
-// Structure that actually start and stop threads
-forall( dtype T | sized(T) | is_thread(T) )
-struct scoped {
-	T handle;
-};
-
-forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
-void ?{}( scoped(T)* this );
-
-forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
-void ?{}( scoped(T)* this, P params );
-
-forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
-void ^?{}( scoped(T)* this );
-
-void yield();
-
-#endif //THREADS_H
-
-// Local Variables: //
-// mode: c //
-// tab-width: 4 //
-// End: //
Index: c/libcfa/concurrency/threads.c
===================================================================
--- src/libcfa/concurrency/threads.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ 	(revision )
@@ -1,131 +1,0 @@
-//                              -*- 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.
-//
-// threads.c --
-//
-// Author           : Thierry Delisle
-// Created On       : Tue Jan 17 12:27:26 2017
-// Last Modified By : Thierry Delisle
-// Last Modified On : --
-// Update Count     : 0
-//
-
-#include "threads"
-
-#include "kernel_private.h"
-#include "libhdr.h"
-
-#define __CFA_INVOKE_PRIVATE__
-#include "invoke.h"
-
-extern "C" {
-	#include <fenv.h>
-	#include <stddef.h>
-}
-
-extern processor * get_this_processor();
-
-//-----------------------------------------------------------------------------
-// Forward declarations
-forall( dtype T | is_thread(T) )
-void start( T* this );
-
-forall( dtype T | is_thread(T) )
-void stop( T* this );
-
-//-----------------------------------------------------------------------------
-// Thread ctors and dtors
-
-void ?{}(thread* this) {
-	(&this->c){};
-	this->c.name = "Anonymous Coroutine";
-	(&this->terminated){};
-	this->next = NULL;
-}
-
-void ^?{}(thread* this) {
-	^(&this->c){};
-}
-
-forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
-void ?{}( scoped(T)* this ) {
-	(&this->handle){};
-	start(&this->handle);
-}
-
-forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
-void ?{}( scoped(T)* this, P params ) {
-	(&this->handle){ params };
-	start(&this->handle);
-}
-
-forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
-void ^?{}( scoped(T)* this ) {
-	stop(&this->handle);
-	^(&this->handle){};
-}
-
-//-----------------------------------------------------------------------------
-// Starting and stopping threads
-forall( dtype T | is_thread(T) )
-void start( T* this ) {
-	coroutine* thrd_c = get_coroutine(this);
-	thread*  thrd_h = get_thread   (this);
-	thrd_c->last = this_coroutine();
-	get_this_processor()->current_coroutine = thrd_c;
-
-	LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
-
-	create_stack(&thrd_c->stack, thrd_c->stack.size);
-	CtxStart(this, CtxInvokeThread);
-	CtxSwitch( thrd_c->last->stack.context, thrd_c->stack.context );
-
-	ScheduleThread(thrd_h);
-}
-
-forall( dtype T | is_thread(T) )
-void stop( T* this ) {
-	wait( & get_thread(this)->terminated );	
-}
-
-void yield( void ) {
-	ScheduleInternal( get_this_processor()->current_thread );
-}
-
-void ThreadCtxSwitch(coroutine* src, coroutine* dst) {
-	// set state of current coroutine to inactive
-	src->state = Inactive;
-	dst->state = Active;
-
-	//update the last resumer
-	dst->last = src;
-
-	// set new coroutine that the processor is executing
-	// and context switch to it
-	get_this_processor()->current_coroutine = dst;	
-	CtxSwitch( src->stack.context, dst->stack.context );
-	get_this_processor()->current_coroutine = src;	
-
-	// set state of new coroutine to active
-	dst->state = Inactive;
-	src->state = Active;
-}
-
-// C Helper to signal the termination of a thread
-// Used in invoke.c
-extern "C" {
-	void __thread_signal_termination( thread * this ) {
-		this->c.state = Halted;
-		LIB_DEBUG_PRINTF("Thread end : %p\n", this);
-		signal( &this->terminated );	
-	}
-}
-
-// Local Variables: //
-// mode: c //
-// tab-width: 4 //
-// End: //
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/main.cc	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -32,4 +32,5 @@
 #include "GenPoly/CopyParams.h"
 #include "GenPoly/InstantiateGeneric.h"
+#include "Concurrency/Keywords.h"
 #include "CodeGen/Generate.h"
 #include "CodeGen/FixNames.h"
@@ -236,4 +237,6 @@
 		OPTPRINT( "mutate" )
 		ControlStruct::mutate( translationUnit );
+		OPTPRINT( "Concurrency" )
+		Concurrency::applyKeywords( translationUnit );
 		OPTPRINT( "fixNames" )
 		CodeGen::fixNames( translationUnit );
Index: src/tests/coroutine.c
===================================================================
--- src/tests/coroutine.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/tests/coroutine.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -1,8 +1,8 @@
 #include <fstream>
-#include <coroutines>
+#include <coroutine>
 
 struct Fibonacci {
       int fn; // used for communication
-      coroutine c;
+      coroutine_desc c;
 };
 
@@ -11,5 +11,5 @@
 }
 
-coroutine* get_coroutine(Fibonacci* this) {
+coroutine_desc* get_coroutine(Fibonacci* this) {
       return &this->c;
 }
@@ -47,7 +47,7 @@
 #ifdef MORE_DEBUG      
       Fibonacci *pf1 = &f1, *pf2 = &f2;
-      coroutine *cf1 = &f1.c, *cf2 = &f2.c;
+      coroutine_desc *cf1 = &f1.c, *cf2 = &f2.c;
       covptr_t  *vf1 = vtable(pf1), *vf2 = vtable(pf2);
-      coroutine *cv1 = get_coroutine(vf1), *cv2 = get_coroutine(vf2);
+      coroutine_desc *cv1 = get_coroutine(vf1), *cv2 = get_coroutine(vf2);
       Fibonacci *ov1 = (Fibonacci *)get_object(vf1), *ov2 = (Fibonacci *)get_object(vf2);
 
Index: src/tests/monitor.c
===================================================================
--- src/tests/monitor.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/tests/monitor.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -2,9 +2,9 @@
 #include <kernel>
 #include <monitor>
-#include <threads>
+#include <thread>
 
 struct global_t {
 	int value;
-	__monitor_t m;
+	monitor_desc m;
 };
 
@@ -16,5 +16,5 @@
 
 void increment( /*mutex*/ global_t * this ) {
-	__monitor_t * mon = &this->m;
+	monitor_desc * mon = &this->m;
 	monitor_guard_t g1 = { &mon };
 	{
@@ -27,5 +27,5 @@
 }
 
-struct MyThread { thread t; };
+struct MyThread { thread_desc t; };
 
 DECL_THREAD(MyThread);
Index: src/tests/multi-monitor.c
===================================================================
--- src/tests/multi-monitor.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/tests/multi-monitor.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -2,12 +2,12 @@
 #include <kernel>
 #include <monitor>
-#include <threads>
+#include <thread>
 
 static int global12, global23, global13;
 
-static __monitor_t m1, m2, m3;
+static monitor_desc m1, m2, m3;
 
-void increment( /*mutex*/ __monitor_t * p1, /*mutex*/ __monitor_t * p2, int * value ) {
-	__monitor_t * mons[] = { p1, p2 };
+void increment( /*mutex*/ monitor_desc * p1, /*mutex*/ monitor_desc * p2, int * value ) {
+	monitor_desc * mons[] = { p1, p2 };
 	monitor_guard_t g = { mons, 2 };
 	*value += 1;
@@ -15,5 +15,5 @@
 
 struct MyThread { 
-	thread t; 
+	thread_desc t; 
 	int target;
 };
Index: src/tests/test.py
===================================================================
--- src/tests/test.py	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/tests/test.py	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -250,5 +250,5 @@
 parser = argparse.ArgumentParser(description='Script which runs cforall tests')
 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no')
-parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='no')
+parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='yes')
 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
 parser.add_argument('--list', help='List all test available', action='store_true')
Index: src/tests/thread.c
===================================================================
--- src/tests/thread.c	(revision 5a3ac848c64ea57337a51b1cff756fb8e593d201)
+++ src/tests/thread.c	(revision 9b443c7fd43d5afe0796b5ad610c1738998adaec)
@@ -2,8 +2,8 @@
 #include <kernel>
 #include <stdlib>
-#include <threads>
+#include <thread>
 
-struct First { thread t; signal_once* lock; };
-struct Second { thread t; signal_once* lock; };
+struct First { thread_desc t; signal_once* lock; };
+struct Second { thread_desc t; signal_once* lock; };
 
 DECL_THREAD(First);
