Index: libcfa/src/concurrency/alarm.cfa
===================================================================
--- libcfa/src/concurrency/alarm.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/alarm.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jun 2 11:31:25 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri May 25 06:25:47 2018
-// Update Count     : 67
+// Last Modified On : Tue Dec  3 22:47:24 2019
+// Update Count     : 68
 //
 
@@ -40,5 +40,5 @@
 void __kernel_set_timer( Duration alarm ) {
 	verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%jins)", alarm.tv);
-	setitimer( ITIMER_REAL, &(itimerval){ alarm }, NULL );
+	setitimer( ITIMER_REAL, &(itimerval){ alarm }, 0p );
 }
 
@@ -113,5 +113,5 @@
 			this->tail = &this->head;
 		}
-		head->next = NULL;
+		head->next = 0p;
 	}
 	verify( validate( this ) );
@@ -127,5 +127,5 @@
 		this->tail = it;
 	}
-	n->next = NULL;
+	n->next = 0p;
 
 	verify( validate( this ) );
Index: libcfa/src/concurrency/coroutine.cfa
===================================================================
--- libcfa/src/concurrency/coroutine.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/coroutine.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -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 17:20:57 2018
-// Update Count     : 9
+// Last Modified On : Thu Dec  5 14:37:29 2019
+// Update Count     : 15
 //
 
@@ -90,11 +90,11 @@
 
 void ?{}( coroutine_desc & this, const char * name, void * storage, size_t storageSize ) with( this ) {
-	(this.context){NULL, NULL};
+	(this.context){0p, 0p};
 	(this.stack){storage, storageSize};
 	this.name = name;
 	state = Start;
-	starter = NULL;
-	last = NULL;
-	cancellation = NULL;
+	starter = 0p;
+	last = 0p;
+	cancellation = 0p;
 }
 
@@ -131,5 +131,5 @@
 
 [void *, size_t] __stack_alloc( size_t storageSize ) {
-	static const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
+	const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
 	assert(__page_size != 0l);
 	size_t size = libCeiling( storageSize, 16 ) + stack_data_size;
@@ -157,5 +157,5 @@
 
 void __stack_prepare( __stack_info_t * this, size_t create_size ) {
-	static const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
+	const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
 	bool userStack;
 	void * storage;
Index: libcfa/src/concurrency/coroutine.hfa
===================================================================
--- libcfa/src/concurrency/coroutine.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/coroutine.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Nov 28 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 21 17:49:39 2019
-// Update Count     : 9
+// Last Modified On : Tue Dec  3 22:47:58 2019
+// Update Count     : 10
 //
 
@@ -38,9 +38,9 @@
 void ^?{}( coroutine_desc & this );
 
-static inline void ?{}( coroutine_desc & this)                                       { this{ "Anonymous Coroutine", NULL, 0 }; }
-static inline void ?{}( coroutine_desc & this, size_t stackSize)                     { this{ "Anonymous Coroutine", NULL, stackSize }; }
+static inline void ?{}( coroutine_desc & this)                                       { this{ "Anonymous Coroutine", 0p, 0 }; }
+static inline void ?{}( coroutine_desc & this, size_t stackSize)                     { this{ "Anonymous Coroutine", 0p, stackSize }; }
 static inline void ?{}( coroutine_desc & this, void * storage, size_t storageSize )  { this{ "Anonymous Coroutine", storage, storageSize }; }
-static inline void ?{}( coroutine_desc & this, const char * name)                    { this{ name, NULL, 0 }; }
-static inline void ?{}( coroutine_desc & this, const char * name, size_t stackSize ) { this{ name, NULL, stackSize }; }
+static inline void ?{}( coroutine_desc & this, const char * name)                    { this{ name, 0p, 0 }; }
+static inline void ?{}( coroutine_desc & this, const char * name, size_t stackSize ) { this{ name, 0p, stackSize }; }
 
 //-----------------------------------------------------------------------------
@@ -89,5 +89,5 @@
 	src->state = Active;
 
-	if( unlikely(src->cancellation != NULL) ) {
+	if( unlikely(src->cancellation != 0p) ) {
 		_CtxCoroutine_Unwind(src->cancellation, src);
 	}
@@ -128,5 +128,5 @@
 	coroutine_desc * dst = get_coroutine(cor);
 
-	if( unlikely(dst->context.SP == NULL) ) {
+	if( unlikely(dst->context.SP == 0p) ) {
 		__stack_prepare(&dst->stack, 65000);
 		CtxStart(&cor, CtxInvokeCoroutine);
Index: libcfa/src/concurrency/invoke.h
===================================================================
--- libcfa/src/concurrency/invoke.h	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/invoke.h	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 22 18:19:13 2019
-// Update Count     : 40
+// Last Modified On : Thu Dec  5 16:26:03 2019
+// Update Count     : 44
 //
 
@@ -215,5 +215,5 @@
 
 		static inline void ?{}(__monitor_group_t & this) {
-			(this.data){NULL};
+			(this.data){0p};
 			(this.size){0};
 			(this.func){NULL};
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/kernel.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 21 16:46:59 2019
-// Update Count     : 27
+// Last Modified On : Thu Dec  5 16:25:52 2019
+// Update Count     : 52
 //
 
@@ -26,4 +26,6 @@
 #include <signal.h>
 #include <unistd.h>
+#include <limits.h>										// PTHREAD_STACK_MIN
+#include <sys/mman.h>									// mprotect
 }
 
@@ -40,5 +42,5 @@
 //-----------------------------------------------------------------------------
 // Some assembly required
-#if   defined( __i386 )
+#if defined( __i386 )
 	#define CtxGet( ctx )        \
 		__asm__ volatile (     \
@@ -123,5 +125,5 @@
 
 extern "C" {
-struct { __dllist_t(cluster) list; __spinlock_t lock; } __cfa_dbg_global_clusters;
+	struct { __dllist_t(cluster) list; __spinlock_t lock; } __cfa_dbg_global_clusters;
 }
 
@@ -131,5 +133,5 @@
 // Global state
 thread_local struct KernelThreadData kernelTLS __attribute__ ((tls_model ( "initial-exec" ))) = {
-	NULL,
+	NULL,												// cannot use 0p
 	NULL,
 	{ 1, false, false },
@@ -140,8 +142,8 @@
 // Struct to steal stack
 struct current_stack_info_t {
-	__stack_t * storage;		// pointer to stack object
-	void *base;				// base of stack
-	void *limit;			// stack grows towards stack limit
-	void *context;			// address of cfa_context_t
+	__stack_t * storage;								// pointer to stack object
+	void * base;										// base of stack
+	void * limit;										// stack grows towards stack limit
+	void * context;										// address of cfa_context_t
 };
 
@@ -172,7 +174,7 @@
 	name = "Main Thread";
 	state = Start;
-	starter = NULL;
-	last = NULL;
-	cancellation = NULL;
+	starter = 0p;
+	last = 0p;
+	cancellation = 0p;
 }
 
@@ -188,6 +190,6 @@
 	link.prev = 0p;
 
-	node.next = NULL;
-	node.prev = NULL;
+	node.next = 0p;
+	node.prev = 0p;
 	doregister(curr_cluster, this);
 
@@ -214,5 +216,5 @@
 	terminated{ 0 };
 	do_terminate = false;
-	preemption_alarm = NULL;
+	preemption_alarm = 0p;
 	pending_preemption = false;
 	runner.proc = &this;
@@ -234,5 +236,6 @@
 	}
 
-	pthread_join( kernel_thread, NULL );
+	pthread_join( kernel_thread, 0p );
+	free( this.stack );
 }
 
@@ -284,11 +287,9 @@
 		__cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
 
-		thread_desc * readyThread = NULL;
-		for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ )
-		{
+		thread_desc * readyThread = 0p;
+		for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ ) {
 			readyThread = nextThread( this->cltr );
 
-			if(readyThread)
-			{
+			if(readyThread) {
 				verify( ! kernelTLS.preemption_state.enabled );
 
@@ -301,7 +302,5 @@
 
 				spin_count = 0;
-			}
-			else
-			{
+			} else {
 				// spin(this, &spin_count);
 				halt(this);
@@ -423,5 +422,5 @@
 	processor * proc = (processor *) arg;
 	kernelTLS.this_processor = proc;
-	kernelTLS.this_thread    = NULL;
+	kernelTLS.this_thread    = 0p;
 	kernelTLS.preemption_state.[enabled, disable_count] = [false, 1];
 	// SKULLDUGGERY: We want to create a context for the processor coroutine
@@ -436,5 +435,5 @@
 
 	//Set global state
-	kernelTLS.this_thread    = NULL;
+	kernelTLS.this_thread = 0p;
 
 	//We now have a proper context from which to schedule threads
@@ -452,5 +451,39 @@
 	__cfaabi_dbg_print_safe("Kernel : core %p main ended (%p)\n", proc, &proc->runner);
 
-	return NULL;
+	return 0p;
+}
+
+static void Abort( int ret, const char * func ) {
+	if ( ret ) {										// pthread routines return errno values
+		abort( "%s : internal error, error(%d) %s.", func, ret, strerror( ret ) );
+	} // if
+} // Abort
+
+void * create_pthread( pthread_t * pthread, void * (*start)(void *), void * arg ) {
+	pthread_attr_t attr;
+
+	Abort( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
+
+	size_t stacksize;
+	// default stack size, normally defined by shell limit
+	Abort( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
+	assert( stacksize >= PTHREAD_STACK_MIN );
+
+	void * stack;
+	__cfaabi_dbg_debug_do(
+		stack = memalign( __page_size, stacksize + __page_size );
+		// pthread has no mechanism to create the guard page in user supplied stack.
+		if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
+			abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
+		} // if
+	);
+	__cfaabi_dbg_no_debug_do(
+		stack = malloc( stacksize );
+	);
+
+	Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
+
+	Abort( pthread_create( pthread, &attr, start, arg ), "pthread_create" );
+	return stack;
 }
 
@@ -458,5 +491,5 @@
 	__cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
 
-	pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
+	this->stack = create_pthread( &this->kernel_thread, CtxInvokeProcessor, (void *)this );
 
 	__cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
@@ -515,5 +548,5 @@
 	verify( ! kernelTLS.preemption_state.enabled );
 
-	verifyf( thrd->link.next == NULL, "Expected null got %p", thrd->link.next );
+	verifyf( thrd->link.next == 0p, "Expected null got %p", thrd->link.next );
 
 
@@ -695,5 +728,5 @@
 	void ?{}(processorCtx_t & this, processor * proc) {
 		(this.__cor){ "Processor" };
-		this.__cor.starter = NULL;
+		this.__cor.starter = 0p;
 		this.proc = proc;
 	}
@@ -704,5 +737,5 @@
 		terminated{ 0 };
 		do_terminate = false;
-		preemption_alarm = NULL;
+		preemption_alarm = 0p;
 		pending_preemption = false;
 		kernel_thread = pthread_self();
@@ -907,5 +940,5 @@
 
 void V(semaphore & this) with( this ) {
-	thread_desc * thrd = NULL;
+	thread_desc * thrd = 0p;
 	lock( lock __cfaabi_dbg_ctx2 );
 	count += 1;
Index: libcfa/src/concurrency/kernel.hfa
===================================================================
--- libcfa/src/concurrency/kernel.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/kernel.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 22 11:39:17 2019
-// Update Count     : 16
+// Last Modified On : Wed Dec  4 07:54:51 2019
+// Update Count     : 18
 //
 
@@ -89,6 +89,6 @@
 static inline void ?{}(FinishAction & this) {
 	this.action_code = No_Action;
-	this.thrd = NULL;
-	this.lock = NULL;
+	this.thrd = 0p;
+	this.lock = 0p;
 }
 static inline void ^?{}(FinishAction &) {}
@@ -135,4 +135,7 @@
 	// Termination synchronisation
 	semaphore terminated;
+
+	// pthread Stack
+	void * stack;
 
 	// Link lists fields
Index: libcfa/src/concurrency/kernel_private.hfa
===================================================================
--- libcfa/src/concurrency/kernel_private.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/kernel_private.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Feb 13 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 29 14:06:40 2018
-// Update Count     : 3
+// Last Modified On : Sat Nov 30 19:25:02 2019
+// Update Count     : 8
 //
 
@@ -57,4 +57,6 @@
 void main(processorCtx_t *);
 
+void * create_pthread( pthread_t *, void * (*)(void *), void * );
+
 static inline void wake_fast(processor * this) {
 	__cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this);
Index: libcfa/src/concurrency/monitor.cfa
===================================================================
--- libcfa/src/concurrency/monitor.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/monitor.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Thd Feb 23 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 14:30:26 2018
-// Update Count     : 9
+// Last Modified On : Wed Dec  4 07:55:14 2019
+// Update Count     : 10
 //
 
@@ -363,5 +363,5 @@
 	this.waiting_thread = waiting_thread;
 	this.count = count;
-	this.next = NULL;
+	this.next = 0p;
 	this.user_info = user_info;
 }
@@ -369,7 +369,7 @@
 void ?{}(__condition_criterion_t & this ) with( this ) {
 	ready  = false;
-	target = NULL;
-	owner  = NULL;
-	next   = NULL;
+	target = 0p;
+	owner  = 0p;
+	next   = 0p;
 }
 
@@ -378,5 +378,5 @@
 	this.target = target;
 	this.owner  = &owner;
-	this.next   = NULL;
+	this.next   = 0p;
 }
 
@@ -387,5 +387,5 @@
 
 	// Check that everything is as expected
-	assertf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
+	assertf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
 	verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
 	verifyf( this.monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count );
@@ -449,5 +449,5 @@
 
 	// Lock all monitors
-	lock_all( this.monitors, NULL, count );
+	lock_all( this.monitors, 0p, count );
 
 	//Pop the head of the waiting queue
@@ -471,5 +471,5 @@
 
 	//Check that everything is as expected
-	verifyf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
+	verifyf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
 	verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
 
@@ -674,6 +674,6 @@
 
 static inline void reset_mask( monitor_desc * this ) {
-	this->mask.accepted = NULL;
-	this->mask.data = NULL;
+	this->mask.accepted = 0p;
+	this->mask.data = 0p;
 	this->mask.size = 0;
 }
@@ -816,6 +816,6 @@
 	}
 
-	__cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
-	return ready2run ? node->waiting_thread : NULL;
+	__cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : 0p );
+	return ready2run ? node->waiting_thread : 0p;
 }
 
@@ -824,5 +824,5 @@
 	if( !this.monitors ) {
 		// __cfaabi_dbg_print_safe( "Branding\n" );
-		assertf( thrd->monitors.data != NULL, "No current monitor to brand condition %p", thrd->monitors.data );
+		assertf( thrd->monitors.data != 0p, "No current monitor to brand condition %p", thrd->monitors.data );
 		this.monitor_count = thrd->monitors.size;
 
Index: libcfa/src/concurrency/monitor.hfa
===================================================================
--- libcfa/src/concurrency/monitor.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/monitor.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Thd Feb 23 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Oct  7 18:06:45 2017
-// Update Count     : 10
+// Last Modified On : Wed Dec  4 07:55:32 2019
+// Update Count     : 11
 //
 
@@ -31,10 +31,10 @@
 	entry_queue{};
 	signal_stack{};
-	owner         = NULL;
+	owner         = 0p;
 	recursion     = 0;
-	mask.accepted = NULL;
-	mask.data     = NULL;
+	mask.accepted = 0p;
+	mask.data     = 0p;
 	mask.size     = 0;
-	dtor_node     = NULL;
+	dtor_node     = 0p;
 }
 
@@ -122,5 +122,5 @@
 
 static inline void ?{}( condition & this ) {
-	this.monitors = NULL;
+	this.monitors = 0p;
 	this.monitor_count = 0;
 }
Index: libcfa/src/concurrency/mutex.cfa
===================================================================
--- libcfa/src/concurrency/mutex.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/mutex.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -11,7 +11,7 @@
 // Author           : Thierry Delisle
 // Created On       : Fri May 25 01:37:11 2018
-// Last Modified By : Thierry Delisle
-// Last Modified On : Fri May 25 01:37:51 2018
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec  4 09:16:39 2019
+// Update Count     : 1
 //
 
@@ -73,5 +73,5 @@
 	this.lock{};
 	this.blocked_threads{};
-	this.owner = NULL;
+	this.owner = 0p;
 	this.recursion_count = 0;
 }
@@ -83,5 +83,5 @@
 void lock(recursive_mutex_lock & this) with(this) {
 	lock( lock __cfaabi_dbg_ctx2 );
-	if( owner == NULL ) {
+	if( owner == 0p ) {
 		owner = kernelTLS.this_thread;
 		recursion_count = 1;
@@ -101,5 +101,5 @@
 	bool ret = false;
 	lock( lock __cfaabi_dbg_ctx2 );
-	if( owner == NULL ) {
+	if( owner == 0p ) {
 		owner = kernelTLS.this_thread;
 		recursion_count = 1;
Index: libcfa/src/concurrency/mutex.hfa
===================================================================
--- libcfa/src/concurrency/mutex.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/mutex.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -11,7 +11,7 @@
 // Author           : Thierry Delisle
 // Created On       : Fri May 25 01:24:09 2018
-// Last Modified By : Thierry Delisle
-// Last Modified On : Fri May 25 01:24:12 2018
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec  4 09:16:53 2019
+// Update Count     : 1
 //
 
@@ -110,5 +110,5 @@
 
 	static inline void ?{}(lock_scope(L) & this) {
-		this.locks = NULL;
+		this.locks = 0p;
 		this.count = 0;
 	}
Index: libcfa/src/concurrency/preemption.cfa
===================================================================
--- libcfa/src/concurrency/preemption.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/preemption.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jun  5 17:35:49 2018
-// Update Count     : 37
+// Last Modified On : Thu Dec  5 16:34:05 2019
+// Update Count     : 43
 //
 
@@ -24,4 +24,5 @@
 #include <string.h>
 #include <unistd.h>
+#include <limits.h>										// PTHREAD_STACK_MIN
 }
 
@@ -64,4 +65,5 @@
 event_kernel_t * event_kernel;                        // kernel public handle to even kernel
 static pthread_t alarm_thread;                        // pthread handle to alarm thread
+static void * alarm_stack;							  // pthread stack for alarm thread
 
 static void ?{}(event_kernel_t & this) with( this ) {
@@ -81,14 +83,14 @@
 // Get next expired node
 static inline alarm_node_t * get_expired( alarm_list_t * alarms, Time currtime ) {
-	if( !alarms->head ) return NULL;                          // If no alarms return null
-	if( alarms->head->alarm >= currtime ) return NULL;        // If alarms head not expired return null
-	return pop(alarms);                                       // Otherwise just pop head
+	if( !alarms->head ) return 0p;						// If no alarms return null
+	if( alarms->head->alarm >= currtime ) return 0p;	// If alarms head not expired return null
+	return pop(alarms);									// Otherwise just pop head
 }
 
 // Tick one frame of the Discrete Event Simulation for alarms
 static void tick_preemption() {
-	alarm_node_t * node = NULL;                     // Used in the while loop but cannot be declared in the while condition
-	alarm_list_t * alarms = &event_kernel->alarms;  // Local copy for ease of reading
-	Time currtime = __kernel_get_time();			// Check current time once so we everything "happens at once"
+	alarm_node_t * node = 0p;							// Used in the while loop but cannot be declared in the while condition
+	alarm_list_t * alarms = &event_kernel->alarms;		// Local copy for ease of reading
+	Time currtime = __kernel_get_time();				// Check current time once so everything "happens at once"
 
 	//Loop throught every thing expired
@@ -243,5 +245,5 @@
 	sigaddset( &mask, sig );
 
-	if ( pthread_sigmask( SIG_UNBLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -254,5 +256,5 @@
 	sigaddset( &mask, sig );
 
-	if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -301,9 +303,9 @@
 
 	// Setup proper signal handlers
-	__cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART );         // CtxSwitch handler
+	__cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART ); // CtxSwitch handler
 
 	signal_block( SIGALRM );
 
-	pthread_create( &alarm_thread, NULL, alarm_loop, NULL );
+	alarm_stack = create_pthread( &alarm_thread, alarm_loop, 0p );
 }
 
@@ -316,5 +318,5 @@
 	sigset_t mask;
 	sigfillset( &mask );
-	sigprocmask( SIG_BLOCK, &mask, NULL );
+	sigprocmask( SIG_BLOCK, &mask, 0p );
 
 	// Notify the alarm thread of the shutdown
@@ -323,5 +325,7 @@
 
 	// Wait for the preemption thread to finish
-	pthread_join( alarm_thread, NULL );
+
+	pthread_join( alarm_thread, 0p );
+	free( alarm_stack );
 
 	// Preemption is now fully stopped
@@ -380,5 +384,5 @@
 	static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" );
 	#endif
-	if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) {
 		abort( "internal error, sigprocmask" );
 	}
@@ -399,5 +403,5 @@
 	sigset_t mask;
 	sigfillset(&mask);
-	if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -420,5 +424,5 @@
 					{__cfaabi_dbg_print_buffer_decl( " KERNEL: Spurious wakeup %d.\n", err );}
 					continue;
-       			case EINVAL :
+				case EINVAL :
 				 	abort( "Timeout was invalid." );
 				default:
@@ -453,5 +457,5 @@
 EXIT:
 	__cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
-	return NULL;
+	return 0p;
 }
 
@@ -466,5 +470,5 @@
 	sigset_t oldset;
 	int ret;
-	ret = pthread_sigmask(0, NULL, &oldset);
+	ret = pthread_sigmask(0, 0p, &oldset);
 	if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); }
 
Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/thread.cfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 17:19:52 2018
-// Update Count     : 8
+// Last Modified On : Wed Dec  4 09:17:49 2019
+// Update Count     : 9
 //
 
@@ -33,5 +33,5 @@
 // Thread ctors and dtors
 void ?{}(thread_desc & this, const char * const name, cluster & cl, void * storage, size_t storageSize ) with( this ) {
-	context{ NULL, NULL };
+	context{ 0p, 0p };
 	self_cor{ name, storage, storageSize };
 	state = Start;
@@ -44,6 +44,6 @@
 	link.prev = 0p;
 
-	node.next = NULL;
-	node.prev = NULL;
+	node.next = 0p;
+	node.prev = 0p;
 	doregister(curr_cluster, this);
 
Index: libcfa/src/concurrency/thread.hfa
===================================================================
--- libcfa/src/concurrency/thread.hfa	(revision b798713f34d313e4f132850f1f6d89bdc4947d8b)
+++ libcfa/src/concurrency/thread.hfa	(revision f80f840a5fd641f4532351b618dfd8c32a670fc5)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 21 17:51:33 2019
-// Update Count     : 5
+// Last Modified On : Wed Dec  4 09:18:14 2019
+// Update Count     : 6
 //
 
@@ -61,13 +61,13 @@
 void ^?{}(thread_desc & this);
 
-static inline void ?{}(thread_desc & this)                                                                  { this{ "Anonymous Thread", *mainCluster, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this)                                                                  { this{ "Anonymous Thread", *mainCluster, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, 0p, stackSize }; }
 static inline void ?{}(thread_desc & this, void * storage, size_t storageSize )                             { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; }
-static inline void ?{}(thread_desc & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, 0p, stackSize }; }
 static inline void ?{}(thread_desc & this, struct cluster & cl, void * storage, size_t storageSize )        { this{ "Anonymous Thread", cl, storage, storageSize }; }
-static inline void ?{}(thread_desc & this, const char * const name)                                         { this{ name, *mainCluster, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl )                   { this{ name, cl, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this, const char * const name)                                         { this{ name, *mainCluster, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl )                   { this{ name, cl, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; }
 
 //-----------------------------------------------------------------------------
