Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision 7f62b70877e4fa96cf64abb308b9ef2b9528dde9)
+++ src/Concurrency/Keywords.cc	(revision 6cebfefc948a4195311c8d0203ba01ed9c1a1bb3)
@@ -302,4 +302,5 @@
 		void postvisit( FunctionDecl * decl );
 		void postvisit(   StructDecl * decl );
+		Statement * postmutate( MutexStmt * stmt );
 
 		std::list<DeclarationWithType*> findMutexArgs( FunctionDecl*, bool & first );
@@ -307,4 +308,5 @@
 		void addDtorStatements( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);
 		void addStatements( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);
+		void addStatements( CompoundStmt * body, const std::list<Expression * > & args );
 		void addThreadDtorStatements( FunctionDecl* func, CompoundStmt * body, const std::list<DeclarationWithType * > & args );
 
@@ -312,4 +314,5 @@
 			PassVisitor< MutexKeyword > impl;
 			acceptAll( translationUnit, impl );
+			mutateAll( translationUnit, impl );
 		}
 
@@ -935,4 +938,12 @@
 			thread_guard_decl = decl;
 		}
+	}
+
+	Statement * MutexKeyword::postmutate( MutexStmt * stmt ) {
+		std::list<Statement *> stmtsForCtor;
+		stmtsForCtor.push_back(stmt->stmt);
+		CompoundStmt * body = new CompoundStmt( stmtsForCtor );
+		addStatements( body, stmt->mutexObjs);
+		return body;
 	}
 
@@ -1058,4 +1069,60 @@
 			))
 		);
+	}
+
+	void MutexKeyword::addStatements( CompoundStmt * body, const std::list<Expression * > & args ) {
+		ObjectDecl * monitors = new ObjectDecl(
+			"__monitors",
+			noStorageClasses,
+			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, [](Expression * var ){
+					return new SingleInit( new UntypedExpr(
+						new NameExpr( "get_monitor" ),
+						{ var }
+					) );
+				})
+			)
+		);
+
+		// in reverse order :
+		// monitor_guard_t __guard = { __monitors, # };
+		body->push_front(
+			new DeclStmt( new ObjectDecl(
+				"__guard",
+				noStorageClasses,
+				LinkageSpec::Cforall,
+				nullptr,
+				new StructInstType(
+					noQualifiers,
+					guard_decl
+				),
+				new ListInit(
+					{
+						new SingleInit( new VariableExpr( monitors ) ),
+						new SingleInit( new ConstantExpr( Constant::from_ulong( args.size() ) ) )
+					},
+					noDesignators,
+					true
+				)
+			))
+		);
+
+		//monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) };
+		body->push_front( new DeclStmt( monitors) );
 	}
 
