Index: libcfa/src/concurrency/coroutine.hfa
===================================================================
--- libcfa/src/concurrency/coroutine.hfa	(revision 10248ae0df771e5e4f6a00c5b977280c857f60bb)
+++ libcfa/src/concurrency/coroutine.hfa	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
@@ -10,6 +10,6 @@
 // Created On       : Mon Nov 28 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 18:23:45 2018
-// Update Count     : 8
+// Last Modified On : Fri Jun 21 17:49:39 2019
+// Update Count     : 9
 //
 
@@ -53,4 +53,6 @@
 forall(dtype T | is_coroutine(T))
 void prime(T & cor);
+
+static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; }
 
 //-----------------------------------------------------------------------------
Index: libcfa/src/concurrency/invoke.h
===================================================================
--- libcfa/src/concurrency/invoke.h	(revision 10248ae0df771e5e4f6a00c5b977280c857f60bb)
+++ libcfa/src/concurrency/invoke.h	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat May 19 08:23:21 2018
-// Update Count     : 31
+// Last Modified On : Sat Jun 22 18:19:13 2019
+// Update Count     : 40
 //
 
@@ -46,6 +46,6 @@
 	#ifdef __cforall
 	extern "Cforall" {
-		static inline struct thread_desc             * & get_next( struct thread_desc             & this );
-		static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );
+		static inline struct thread_desc             *& get_next( struct thread_desc             & this );
+		static inline struct __condition_criterion_t *& get_next( struct __condition_criterion_t & this );
 
 		extern thread_local struct KernelThreadData {
@@ -199,9 +199,5 @@
 	#ifdef __cforall
 	extern "Cforall" {
-		static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; }
-		static inline struct thread_desc    * active_thread   () { return TL_GET( this_thread    ); }
-		static inline struct processor      * active_processor() { return TL_GET( this_processor ); } // UNSAFE
-
-		static inline thread_desc * & get_next( thread_desc & this ) {
+		static inline thread_desc *& get_next( thread_desc & this ) {
 			return this.next;
 		}
@@ -210,6 +206,4 @@
 			return this.node.[next, prev];
 		}
-
-		static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );
 
 		static inline void ?{}(__monitor_group_t & this) {
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 10248ae0df771e5e4f6a00c5b977280c857f60bb)
+++ libcfa/src/concurrency/kernel.cfa	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Apr  9 16:11:46 2018
-// Update Count     : 24
+// Last Modified On : Thu Jun 20 17:21:23 2019
+// Update Count     : 25
 //
 
@@ -907,4 +907,5 @@
 void doregister( cluster * cltr, thread_desc & thrd ) {
 	lock      (cltr->thread_list_lock __cfaabi_dbg_ctx2);
+	cltr->nthreads += 1;
 	push_front(cltr->threads, thrd);
 	unlock    (cltr->thread_list_lock);
@@ -914,4 +915,5 @@
 	lock  (cltr->thread_list_lock __cfaabi_dbg_ctx2);
 	remove(cltr->threads, thrd );
+	cltr->nthreads -= 1;
 	unlock(cltr->thread_list_lock);
 }
@@ -919,4 +921,5 @@
 void doregister( cluster * cltr, processor * proc ) {
 	lock      (cltr->proc_list_lock __cfaabi_dbg_ctx2);
+	cltr->nprocessors += 1;
 	push_front(cltr->procs, *proc);
 	unlock    (cltr->proc_list_lock);
@@ -926,4 +929,5 @@
 	lock  (cltr->proc_list_lock __cfaabi_dbg_ctx2);
 	remove(cltr->procs, *proc );
+	cltr->nprocessors -= 1;
 	unlock(cltr->proc_list_lock);
 }
Index: libcfa/src/concurrency/kernel.hfa
===================================================================
--- libcfa/src/concurrency/kernel.hfa	(revision 10248ae0df771e5e4f6a00c5b977280c857f60bb)
+++ libcfa/src/concurrency/kernel.hfa	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr 10 14:46:49 2018
-// Update Count     : 10
+// Last Modified On : Sat Jun 22 11:39:17 2019
+// Update Count     : 16
 //
 
@@ -91,5 +91,5 @@
 	this.lock = NULL;
 }
-static inline void ^?{}(FinishAction & this) {}
+static inline void ^?{}(FinishAction &) {}
 
 // Processor
@@ -176,8 +176,10 @@
 	__dllist_t(struct processor) procs;
 	__dllist_t(struct processor) idles;
-
-	// List of processors
+	unsigned int nprocessors;
+
+	// List of threads
 	__spinlock_t thread_list_lock;
 	__dllist_t(struct thread_desc) threads;
+	unsigned int nthreads;
 
 	// Link lists fields
@@ -200,4 +202,7 @@
 }
 
+static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE
+static inline struct cluster   * active_cluster  () { return TL_GET( this_processor )->cltr; }
+
 // Local Variables: //
 // mode: c //
Index: libcfa/src/concurrency/thread.hfa
===================================================================
--- libcfa/src/concurrency/thread.hfa	(revision 10248ae0df771e5e4f6a00c5b977280c857f60bb)
+++ libcfa/src/concurrency/thread.hfa	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 29 14:07:11 2018
-// Update Count     : 4
+// Last Modified On : Fri Jun 21 17:51:33 2019
+// Update Count     : 5
 //
 
@@ -91,4 +91,6 @@
 void yield( unsigned times );
 
+static inline struct thread_desc * active_thread () { return TL_GET( this_thread ); }
+
 // Local Variables: //
 // mode: c //
