Index: src/CodeTools/DeclStats.cc
===================================================================
--- src/CodeTools/DeclStats.cc	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/CodeTools/DeclStats.cc	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -200,5 +200,8 @@
 			// skip if already seen declaration for this function
 			const std::string& mangleName = decl->get_mangleName().empty() ? decl->get_name() : decl->get_mangleName();
-			if ( ! seen_names.insert( mangleName ).second ) return;
+			if ( ! seen_names.insert( mangleName ).second ) {
+				maybeAccept( decl->get_statements(), *this );
+				return;
+			}
 			
 			Stats& stats = for_linkage[ decl->get_linkage() ];
@@ -228,4 +231,7 @@
 
 			analyzeFunc( fnTy, stats, stats.params, stats.returns );
+
+			// analyze expressions in decl statements
+			maybeAccept( decl->get_statements(), *this );
 		}
 
Index: src/libcfa/concurrency/monitor
===================================================================
--- src/libcfa/concurrency/monitor	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/libcfa/concurrency/monitor	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -20,4 +20,5 @@
 #include "assert"
 #include "invoke.h"
+#include "stdlib"
 
 struct __monitor_t {
@@ -33,19 +34,38 @@
 }
 
+//Basic entering routine
 void enter(__monitor_t *);
 void leave(__monitor_t *);
 
+//Array entering routine
+void enter(__monitor_t **, int count);
+void leave(__monitor_t **, int count);
+
 struct monitor_guard_t {
-	__monitor_t * m;
+	__monitor_t ** m;
+	int count;
 };
 
-static inline void ?{}( monitor_guard_t * this, __monitor_t * m ) {
+static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) {
+	return ((intptr_t)lhs) < ((intptr_t)rhs);
+}
+
+static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) {
 	this->m = m;
-	enter( this->m );
+	this->count = 1;
+	enter( *this->m );
+}
+
+static inline void ?{}( monitor_guard_t * this, __monitor_t ** m, int count ) {
+	this->m = m;
+	this->count = count;
+	qsort(this->m, count);
+	enter( this->m, this->count );
 }
 
 static inline void ^?{}( monitor_guard_t * this ) {
-	leave( this->m );
+	leave( this->m, this->count );
 }
 
+
 #endif //MONITOR_H
Index: src/libcfa/concurrency/monitor.c
===================================================================
--- src/libcfa/concurrency/monitor.c	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/libcfa/concurrency/monitor.c	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -71,2 +71,16 @@
 	}
 }
+
+void enter(__monitor_t ** monitors, int count) {
+	for(int i = 0; i < count; i++) {
+		// printf("%d\n", i);
+		enter( monitors[i] );
+	}
+}
+
+void leave(__monitor_t ** monitors, int count) {
+	for(int i = count - 1; i >= 0; i--) {
+		// printf("%d\n", i);
+		leave( monitors[i] );
+	}
+}
Index: src/tests/.expect/concurrent/coroutine.txt
===================================================================
--- src/tests/.expect/concurrent/coroutine.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
+++ src/tests/.expect/concurrent/coroutine.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -0,0 +1,10 @@
+0 0
+1 1
+1 1
+2 2
+3 3
+5 5
+8 8
+13 13
+21 21
+34 34
Index: src/tests/.expect/concurrent/monitor.txt
===================================================================
--- src/tests/.expect/concurrent/monitor.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
+++ src/tests/.expect/concurrent/monitor.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -0,0 +1,1 @@
+4000000
Index: src/tests/.expect/concurrent/multi-monitor.txt
===================================================================
--- src/tests/.expect/concurrent/multi-monitor.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
+++ src/tests/.expect/concurrent/multi-monitor.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -0,0 +1,1 @@
+2000000 2000000 2000000
Index: src/tests/.expect/concurrent/thread.txt
===================================================================
--- src/tests/.expect/concurrent/thread.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
+++ src/tests/.expect/concurrent/thread.txt	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -0,0 +1,22 @@
+User main begin
+First : Suspend No. 1
+First : Suspend No. 2
+First : Suspend No. 3
+First : Suspend No. 4
+First : Suspend No. 5
+First : Suspend No. 6
+First : Suspend No. 7
+First : Suspend No. 8
+First : Suspend No. 9
+First : Suspend No. 10
+Second : Suspend No. 1
+Second : Suspend No. 2
+Second : Suspend No. 3
+Second : Suspend No. 4
+Second : Suspend No. 5
+Second : Suspend No. 6
+Second : Suspend No. 7
+Second : Suspend No. 8
+Second : Suspend No. 9
+Second : Suspend No. 10
+User main end
Index: src/tests/.expect/coroutine.txt
===================================================================
--- src/tests/.expect/coroutine.txt	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ 	(revision )
@@ -1,10 +1,0 @@
-0 0
-1 1
-1 1
-2 2
-3 3
-5 5
-8 8
-13 13
-21 21
-34 34
Index: src/tests/.expect/monitor.txt
===================================================================
--- src/tests/.expect/monitor.txt	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-4000000
Index: src/tests/.expect/thread.txt
===================================================================
--- src/tests/.expect/thread.txt	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ 	(revision )
@@ -1,22 +1,0 @@
-User main begin
-First : Suspend No. 1
-First : Suspend No. 2
-First : Suspend No. 3
-First : Suspend No. 4
-First : Suspend No. 5
-First : Suspend No. 6
-First : Suspend No. 7
-First : Suspend No. 8
-First : Suspend No. 9
-First : Suspend No. 10
-Second : Suspend No. 1
-Second : Suspend No. 2
-Second : Suspend No. 3
-Second : Suspend No. 4
-Second : Suspend No. 5
-Second : Suspend No. 6
-Second : Suspend No. 7
-Second : Suspend No. 8
-Second : Suspend No. 9
-Second : Suspend No. 10
-User main end
Index: src/tests/Makefile.am
===================================================================
--- src/tests/Makefile.am	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/tests/Makefile.am	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -17,4 +17,14 @@
 debug=yes
 
+quick_test=vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once
+
+if BUILD_CONCURRENCY
+concurrent=yes
+quick_test+= coroutine thread monitor
+else
+concurrent=no
+endif
+
+
 # applies to both programs
 EXTRA_FLAGS =
@@ -30,8 +40,8 @@
 
 all-local :
-	@+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
+	@+python test.py --debug=${debug} --concurrent=${concurrent} ${quick_test}
 
 all-tests :
-	@+python test.py --all --debug=${debug}		# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
+	@+python test.py --all --debug=${debug} --concurrent=${concurrent}		# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
 
 clean-local :
@@ -39,5 +49,5 @@
 
 list :
-	@+python test.py --list
+	@+python test.py --list --concurrent=${concurrent}
 
 constant0-1DP : constant0-1.c
Index: src/tests/Makefile.in
===================================================================
--- src/tests/Makefile.in	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/tests/Makefile.in	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -37,4 +37,5 @@
 build_triplet = @build@
 host_triplet = @host@
+@BUILD_CONCURRENCY_TRUE@am__append_1 = coroutine thread monitor
 EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \
 	avl_test$(EXEEXT) constant0-1DP$(EXEEXT) \
@@ -222,4 +223,9 @@
 top_srcdir = @top_srcdir@
 debug = yes
+quick_test = vector_test avl_test operators numericConstants \
+	expression enum array typeof cast dtor-early-exit init_once \
+	$(am__append_1)
+@BUILD_CONCURRENCY_FALSE@concurrent = no
+@BUILD_CONCURRENCY_TRUE@concurrent = yes
 
 # applies to both programs
@@ -651,8 +657,8 @@
 
 all-local :
-	@+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
+	@+python test.py --debug=${debug} --concurrent=${concurrent} ${quick_test}
 
 all-tests :
-	@+python test.py --all --debug=${debug}		# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
+	@+python test.py --all --debug=${debug} --concurrent=${concurrent}		# '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
 
 clean-local :
@@ -660,5 +666,5 @@
 
 list :
-	@+python test.py --list
+	@+python test.py --list --concurrent=${concurrent}
 
 constant0-1DP : constant0-1.c
Index: src/tests/monitor.c
===================================================================
--- src/tests/monitor.c	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/tests/monitor.c	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -16,9 +16,10 @@
 
 void increment( /*mutex*/ global_t * this ) {
-	monitor_guard_t g1 = { &this->m };
+	__monitor_t * mon = &this->m;
+	monitor_guard_t g1 = { &mon };
 	{
-		monitor_guard_t g2 = { &this->m };
+		monitor_guard_t g2 = { &mon };
 		{
-			monitor_guard_t g3 = { &this->m };
+			monitor_guard_t g3 = { &mon };
 			this->value += 1;
 		}
Index: src/tests/multi-monitor.c
===================================================================
--- src/tests/multi-monitor.c	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
+++ src/tests/multi-monitor.c	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -0,0 +1,50 @@
+#include <fstream>
+#include <kernel>
+#include <monitor>
+#include <threads>
+
+static int global12, global23, global13;
+
+static __monitor_t m1, m2, m3;
+
+void increment( /*mutex*/ __monitor_t * p1, /*mutex*/ __monitor_t * p2, int * value ) {
+	__monitor_t * mons[] = { p1, p2 };
+	monitor_guard_t g = { mons, 2 };
+	*value += 1;
+}
+
+struct MyThread { 
+	thread t; 
+	int target;
+};
+
+DECL_THREAD(MyThread);
+
+void ?{}( MyThread * this, int target ) {
+	this->target = target;
+}
+
+void main( MyThread* this ) {
+	for(int i = 0; i < 1000000; i++) {
+		choose(this->target) {
+			case 0: increment( &m1, &m2, &global12 );
+			case 1: increment( &m2, &m3, &global23 );
+			case 2: increment( &m1, &m3, &global13 );
+		}
+	}
+}
+
+int main(int argc, char* argv[]) {
+	processor p;
+	{
+		scoped(MyThread) * f[6];
+		for(int i = 0; i < 6; i++) {
+			f[i] = ((scoped(MyThread) *)malloc()){ i % 3 };
+		}
+
+		for(int i = 0; i < 6; i++) {
+			delete( f[i] );
+		}
+	}
+	sout | global12 | global23 | global13 | endl;
+}
Index: src/tests/test.py
===================================================================
--- src/tests/test.py	(revision dd020c0cdff72537d5b1dffcf6920c72db9d585a)
+++ src/tests/test.py	(revision 81912032b17ba009d0af2f3c783bdf37fc024161)
@@ -32,22 +32,29 @@
 	return re.search("ELF\s([0-9]+)-bit", out).group(1)
 
-# reads the directory ./.expect and indentifies the tests
-def listTests():
-	machineType = getMachineType()
+def listTestsFolder(folder) :
+	path = ('./.expect/%s/' % folder) if folder else './.expect/'
+	subpath = "%s/" % folder if folder else ""
 
 	# tests directly in the .expect folder will always be processed
-	generic_list = map(lambda fname: Test(fname, fname),
-		[splitext(f)[0] for f in listdir('./.expect')
+	return map(lambda fname: Test(fname, subpath + fname),
+		[splitext(f)[0] for f in listdir( path )
 		if not f.startswith('.') and f.endswith('.txt')
 		])
 
+# reads the directory ./.expect and indentifies the tests
+def listTests( concurrent ):
+	machineType = getMachineType()
+
+	# tests directly in the .expect folder will always be processed
+	generic_list = listTestsFolder( "" )
+
 	# tests in the machineType folder will be ran only for the corresponding compiler
-	typed_list = map(lambda fname: Test( fname, "%s/%s" % (machineType, fname) ),
-		[splitext(f)[0] for f in listdir("./.expect/%s" % machineType)
-		if not f.startswith('.') and f.endswith('.txt')
-		])
+	typed_list = listTestsFolder( machineType )
+
+	# tests in the concurrent folder will be ran only if concurrency is enabled
+	concurrent_list = listTestsFolder( "concurrent" ) if concurrent else []
 
 	# append both lists to get
-	return generic_list + typed_list
+	return generic_list + typed_list + concurrent_list;
 
 # helper functions to run terminal commands
@@ -194,5 +201,5 @@
 		sys.stderr.flush()
 		return test_failed
-	
+
 	except KeyboardInterrupt:
 		test_failed = True
@@ -243,4 +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('--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')
@@ -261,5 +269,5 @@
 
 # fetch the liest of all valid tests
-allTests = listTests()
+allTests = listTests( options.concurrent )
 
 # if user wants all tests than no other treatement of the test list is required
