Index: src/libcfa/concurrency/CtxSwitch-armv7l.S
===================================================================
--- src/libcfa/concurrency/CtxSwitch-armv7l.S	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
+++ src/libcfa/concurrency/CtxSwitch-armv7l.S	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -0,0 +1,62 @@
+	@ 32 bit ARM context switch
+	@ This function assumes that r9 has no special meaning on the platform it's
+	@ being built on.
+	@ If r9 is special, uncomment the following line and it will be left alone
+
+	@ #define R9_SPECIAL
+
+	#define PTR_BYTE        4
+	#define SP_OFFSET       ( 0 * PTR_BYTE )
+	#define FP_OFFSET       ( 1 * PTR_BYTE )
+	#define PC_OFFSET       ( 2 * PTR_BYTE )
+
+	.text
+	.align  2
+	.global CtxSwitch
+	.type   CtxSwitch, %function
+
+CtxSwitch:
+	@ save callee-saved registers: r4-r8, r10, r11, r13(sp) (plus r9 depending on platform specification)
+	@ I've seen reference to 31 registers on 64-bit, if this is the case, more need to be saved
+	@ save thread state registers: r14(lr)
+	@ r12(ip) is intra-procedure-call scratch register, does not need saving between function calls
+
+	#ifdef R9_SPECIAL
+	stmfd r13!, {r4-r8,r10,r11,r14}
+	#else
+	stmfd r13!, {r4-r11,r14}
+	#endif // R9_SPECIAL
+
+	@ save floating point registers: s16-s31
+	vstmdb r13!, {s16-s31}
+
+	@ save frame pointer and stack pointer to outgoing datastructure
+	str sp, [r0, #SP_OFFSET]
+	str fp, [r0, #FP_OFFSET]
+
+	@ restore frame pointer and stack pointer from incoming datastructure
+	ldr fp, [r1, #FP_OFFSET]
+	ldr sp, [r1, #SP_OFFSET]
+
+	@ restore floating point registers: s16-s31
+	vldm r13!, {s16-s31}
+	@ restore r14(lr)
+	@ restore 64-bit extra registers?
+	@ restore callee-saved registers: r4-r8, r10, r11, r13
+
+	#ifdef R9_SPECIAL
+	ldmfd r13!, {r4-r8,r10,r11,r15}
+	#else
+	ldmfd r13!, {r4-r11,r14}    @ loading r14 back into r15 returns
+
+	mov r15, r14
+	#endif // R9_SPECIAL
+	
+	.text
+	.align  2
+	.global CtxInvokeStub
+	.type   CtxInvokeStub, %function
+
+CtxInvokeStub:
+        ldmfd r13!, {r0-r1}
+	mov r15, r1
Index: src/libcfa/concurrency/invoke.c
===================================================================
--- src/libcfa/concurrency/invoke.c	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/invoke.c	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:28:33 2017
-// Update Count     : 1
+// Last Modified On : Tue Jan 23 14:04:56 2018
+// Update Count     : 2
 //
 
@@ -133,4 +133,21 @@
 	((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
 	((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
+
+#elif defined( __ARM_ARCH )
+
+	struct FakeStack {
+		float fpRegs[16];			// floating point registers
+		void *intRegs[9];			// integer/pointer registers
+		void *arg[2];				// placeholder for this pointer
+	};
+
+	((struct machine_context_t *)stack->context)->SP = (char *)stack->base - sizeof( struct FakeStack );
+	((struct machine_context_t *)stack->context)->FP = NULL;
+
+	struct FakeStack *fs = (struct FakeStack *)((struct machine_context_t *)stack->context)->SP;
+
+	fs->intRegs[8] = CtxInvokeStub;
+	fs->arg[0] = this;
+	fs->arg[1] = invoke;
 #else
 	#error Only __i386__ and __x86_64__ is supported for threads in cfa
Index: src/libcfa/concurrency/invoke.h
===================================================================
--- src/libcfa/concurrency/invoke.h	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/invoke.h	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:28:56 2017
-// Update Count     : 1
+// Last Modified On : Tue Jan 23 14:55:46 2018
+// Update Count     : 3
 //
 
@@ -134,4 +134,10 @@
 		// instrusive link field for threads
 		struct thread_desc * next;
+
+		__cfaabi_dbg_debug_do(
+			// instrusive link field for debugging
+			struct thread_desc * dbg_next;
+			struct thread_desc * dbg_prev;
+		)
      };
 
@@ -203,4 +209,9 @@
 			"movl %%ebp,%1\n"   \
 		: "=rm" (ctx.SP), "=rm" (ctx.FP) )
+	#elif defined( __ARM_ARCH )
+	#define CtxGet( ctx ) __asm__ ( \
+			"mov %0,%%sp\n"   \
+			"mov %1,%%r11\n"   \
+		: "=rm" (ctx.SP), "=rm" (ctx.FP) )
 	#endif
 
Index: src/libcfa/concurrency/kernel.c
===================================================================
--- src/libcfa/concurrency/kernel.c	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/kernel.c	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -10,10 +10,11 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:33:18 2017
-// Update Count     : 2
+// Last Modified On : Fri Dec  8 16:23:33 2017
+// Update Count     : 3
 //
 
 //C Includes
 #include <stddef.h>
+#define ftype `ftype`
 extern "C" {
 #include <stdio.h>
@@ -23,4 +24,5 @@
 #include <unistd.h>
 }
+#undef ftype
 
 //CFA Includes
@@ -240,4 +242,5 @@
 void finishRunning(processor * this) with( this->finish ) {
 	if( action_code == Release ) {
+		verify( disable_preempt_count > 1 );
 		unlock( *lock );
 	}
@@ -246,8 +249,10 @@
 	}
 	else if( action_code == Release_Schedule ) {
+		verify( disable_preempt_count > 1 );
 		unlock( *lock );
 		ScheduleThread( thrd );
 	}
 	else if( action_code == Release_Multi ) {
+		verify( disable_preempt_count > lock_count );
 		for(int i = 0; i < lock_count; i++) {
 			unlock( *locks[i] );
@@ -363,5 +368,5 @@
 	this_processor->finish.lock        = lock;
 
-	verify( disable_preempt_count > 0 );
+	verify( disable_preempt_count > 1 );
 	suspend();
 	verify( disable_preempt_count > 0 );
@@ -389,5 +394,5 @@
 	this_processor->finish.thrd        = thrd;
 
-	verify( disable_preempt_count > 0 );
+	verify( disable_preempt_count > 1 );
 	suspend();
 	verify( disable_preempt_count > 0 );
@@ -514,4 +519,9 @@
 }
 
+//=============================================================================================
+// Unexpected Terminating logic
+//=============================================================================================
+
+
 static __spinlock_t kernel_abort_lock;
 static __spinlock_t kernel_debug_lock;
@@ -609,4 +619,37 @@
 }
 
+//-----------------------------------------------------------------------------
+// Debug
+__cfaabi_dbg_debug_do(
+	struct {
+		thread_desc * tail;
+	} __cfaabi_dbg_thread_list = { NULL };
+
+	void __cfaabi_dbg_thread_register( thread_desc * thrd ) {
+		if( !__cfaabi_dbg_thread_list.tail ) {
+			__cfaabi_dbg_thread_list.tail = thrd;
+			return;
+		}
+		__cfaabi_dbg_thread_list.tail->dbg_next = thrd;
+		thrd->dbg_prev = __cfaabi_dbg_thread_list.tail;
+		__cfaabi_dbg_thread_list.tail = thrd;
+	}
+
+	void __cfaabi_dbg_thread_unregister( thread_desc * thrd ) {
+		thread_desc * prev = thrd->dbg_prev;
+		thread_desc * next = thrd->dbg_next;
+
+		if( next ) { next->dbg_prev = prev; }
+		else       {
+			assert( __cfaabi_dbg_thread_list.tail == thrd );
+			__cfaabi_dbg_thread_list.tail = prev;
+		}
+
+		if( prev ) { prev->dbg_next = next; }
+
+		thrd->dbg_prev = NULL;
+		thrd->dbg_next = NULL;
+	}
+)
 // Local Variables: //
 // mode: c //
Index: src/libcfa/concurrency/kernel_private.h
===================================================================
--- src/libcfa/concurrency/kernel_private.h	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/kernel_private.h	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -85,4 +85,9 @@
 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
 
+__cfaabi_dbg_debug_do(
+	extern void __cfaabi_dbg_thread_register  ( thread_desc * thrd );
+	extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd );
+)
+
 //-----------------------------------------------------------------------------
 // Utils
Index: src/libcfa/concurrency/monitor.c
===================================================================
--- src/libcfa/concurrency/monitor.c	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/monitor.c	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -53,10 +53,4 @@
 static inline __lock_size_t aggregate    ( monitor_desc * storage [], const __waitfor_mask_t & mask );
 
-#ifndef __CFA_LOCK_NO_YIELD
-#define DO_LOCK lock_yield
-#else
-#define DO_LOCK lock
-#endif
-
 //-----------------------------------------------------------------------------
 // Useful defines
@@ -90,6 +84,8 @@
 	static void __enter_monitor_desc( monitor_desc * this, const __monitor_group_t & group ) {
 		// Lock the monitor spinlock
-		DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
+		lock( this->lock __cfaabi_dbg_ctx2 );
 		thread_desc * thrd = this_thread;
+
+		verify( disable_preempt_count > 0 );
 
 		__cfaabi_dbg_print_safe("Kernel : %10p Entering mon %p (%p)\n", thrd, this, this->owner);
@@ -121,4 +117,7 @@
 			// Some one else has the monitor, wait in line for it
 			append( this->entry_queue, thrd );
+
+			verify( disable_preempt_count > 0 );
+
 			BlockInternal( &this->lock );
 
@@ -138,5 +137,5 @@
 	static void __enter_monitor_dtor( monitor_desc * this, fptr_t func ) {
 		// Lock the monitor spinlock
-		DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
+		lock( this->lock __cfaabi_dbg_ctx2 );
 		thread_desc * thrd = this_thread;
 
@@ -201,6 +200,6 @@
 	// Leave single monitor
 	void __leave_monitor_desc( monitor_desc * this ) {
-		// Lock the monitor spinlock, DO_LOCK to reduce contention
-		DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
+		// Lock the monitor spinlock
+		lock( this->lock __cfaabi_dbg_ctx2 );
 
 		__cfaabi_dbg_print_safe("Kernel : %10p Leaving mon %p (%p)\n", this_thread, this, this->owner);
@@ -248,5 +247,5 @@
 
 		// Lock the monitor now
-		DO_LOCK( this->lock __cfaabi_dbg_ctx2 );
+		lock( this->lock __cfaabi_dbg_ctx2 );
 
 		disable_interrupts();
@@ -397,6 +396,11 @@
 	append( this.blocked, &waiter );
 
+	verify( disable_preempt_count == 0 );
+
 	// Lock all monitors (aggregates the locks as well)
 	lock_all( monitors, locks, count );
+
+	// verifyf( disable_preempt_count == count, "Got %d, expected %d\n", disable_preempt_count, count );
+	if(disable_preempt_count != count) { __cfaabi_dbg_print_buffer_decl("----------Gonna crash\n"); }
 
 	// Find the next thread(s) to run
@@ -473,6 +477,12 @@
 	monitor_ctx( this.monitors, this.monitor_count );
 
+	verify( disable_preempt_count == 0 );
+
 	// Lock all monitors (aggregates the locks them as well)
 	lock_all( monitors, locks, count );
+
+	// verify( disable_preempt_count == count );
+	if(disable_preempt_count != count) { __cfaabi_dbg_print_buffer_decl("----------Gonna crash\n"); }
+
 
 	// Create the node specific to this wait operation
@@ -737,5 +747,5 @@
 static inline void lock_all( __spinlock_t * locks [], __lock_size_t count ) {
 	for( __lock_size_t i = 0; i < count; i++ ) {
-		DO_LOCK( *locks[i] __cfaabi_dbg_ctx2 );
+		lock( *locks[i] __cfaabi_dbg_ctx2 );
 	}
 }
@@ -744,5 +754,5 @@
 	for( __lock_size_t i = 0; i < count; i++ ) {
 		__spinlock_t * l = &source[i]->lock;
-		DO_LOCK( *l __cfaabi_dbg_ctx2 );
+		lock( *l __cfaabi_dbg_ctx2 );
 		if(locks) locks[i] = l;
 	}
Index: src/libcfa/concurrency/preemption.c
===================================================================
--- src/libcfa/concurrency/preemption.c	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/preemption.c	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -10,25 +10,20 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:36:05 2017
-// Update Count     : 2
+// Last Modified On : Tue Jan 23 17:59:30 2018
+// Update Count     : 7
 //
 
 #include "preemption.h"
 
+#define ftype `ftype`
 extern "C" {
 #include <errno.h>
-#include <execinfo.h>
-#define __USE_GNU
-#include <signal.h>
-#undef __USE_GNU
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 }
-
-
-#ifdef __USE_STREAM__
-#include "fstream"
-#endif
+#undef ftype
+
+#include "bits/signal.h"
 
 //TODO move to defaults
@@ -39,8 +34,4 @@
 	return __CFA_DEFAULT_PREEMPTION__;
 }
-
-// Short hands for signal context information
-#define __CFA_SIGCXT__ ucontext_t *
-#define __CFA_SIGPARMS__ __attribute__((unused)) int sig, __attribute__((unused)) siginfo_t *sfp, __attribute__((unused)) __CFA_SIGCXT__ cxt
 
 // FwdDeclarations : timeout handlers
@@ -53,15 +44,14 @@
 void sigHandler_abort    ( __CFA_SIGPARMS__ );
 
-// FwdDeclarations : sigaction wrapper
-static void __kernel_sigaction( int sig, void (*handler)(__CFA_SIGPARMS__), int flags );
-
 // FwdDeclarations : alarm thread main
 void * alarm_loop( __attribute__((unused)) void * args );
 
 // Machine specific register name
-#ifdef __x86_64__
+#if   defined(__x86_64__)
 #define CFA_REG_IP REG_RIP
-#else
+#elif defined(__i386__)
 #define CFA_REG_IP REG_EIP
+#elif defined(__ARM_ARCH__)
+#define CFA_REG_IP REG_R15
 #endif
 
@@ -179,5 +169,5 @@
 	void enable_interrupts_noPoll() {
 		__attribute__((unused)) unsigned short prev = __atomic_fetch_add_2( &disable_preempt_count, -1, __ATOMIC_SEQ_CST );
-		verify( prev != 0u );                     // If this triggers someone is enabled already enabled interrupts
+		verifyf( prev != 0u, "Incremented from %u\n", prev );                     // If this triggers someone is enabled already enabled interrupts
 	}
 }
@@ -243,6 +233,4 @@
 	// Setup proper signal handlers
 	__kernel_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART );         // CtxSwitch handler
-	// __kernel_sigaction( SIGSEGV, sigHandler_segv     , SA_SIGINFO );      // Failure handler
-	// __kernel_sigaction( SIGBUS , sigHandler_segv     , SA_SIGINFO );      // Failure handler
 
 	signal_block( SIGALRM );
@@ -296,8 +284,14 @@
 // Receives SIGUSR1 signal and causes the current thread to yield
 void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) {
+#if defined( __ARM_ARCH )
+	__cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.arm_pc); )
+#else
 	__cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )
-
-	// Check if it is safe to preempt here
+#endif
+
+		// Check if it is safe to preempt here
 	if( !preemption_ready() ) { return; }
+
+	__cfaabi_dbg_print_buffer_decl(" KERNEL: preempting core %p (%p).\n", this_processor, this_thread);
 
 	preemption_in_progress = true;                      // Sync flag : prevent recursive calls to the signal handler
@@ -371,133 +365,4 @@
 }
 
-// Sigaction wrapper : register an signal handler
-static void __kernel_sigaction( int sig, void (*handler)(__CFA_SIGPARMS__), int flags ) {
-	struct sigaction act;
-
-	act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler;
-	act.sa_flags = flags;
-
-	if ( sigaction( sig, &act, NULL ) == -1 ) {
-		__cfaabi_dbg_print_buffer_decl(
-			" __kernel_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n",
-			sig, handler, flags, errno, strerror( errno )
-		);
-		_exit( EXIT_FAILURE );
-	}
-}
-
-// Sigaction wrapper : restore default handler
-static void __kernel_sigdefault( int sig ) {
-	struct sigaction act;
-
-	act.sa_handler = SIG_DFL;
-	act.sa_flags = 0;
-	sigemptyset( &act.sa_mask );
-
-	if ( sigaction( sig, &act, NULL ) == -1 ) {
-		__cfaabi_dbg_print_buffer_decl(
-			" __kernel_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n",
-			sig, errno, strerror( errno )
-		);
-		_exit( EXIT_FAILURE );
-	}
-}
-
-//=============================================================================================
-// Terminating Signals logic
-//=============================================================================================
-
-__cfaabi_dbg_debug_do(
-	static void __kernel_backtrace( int start ) {
-		// skip first N stack frames
-
-		enum { Frames = 50 };
-		void * array[Frames];
-		int size = backtrace( array, Frames );
-		char ** messages = backtrace_symbols( array, size );
-
-		// find executable name
-		*index( messages[0], '(' ) = '\0';
-		#ifdef __USE_STREAM__
-		serr | "Stack back trace for:" | messages[0] | endl;
-		#else
-		fprintf( stderr, "Stack back trace for: %s\n", messages[0]);
-		#endif
-
-		// skip last 2 stack frames after main
-		for ( int i = start; i < size && messages != NULL; i += 1 ) {
-			char * name = NULL;
-			char * offset_begin = NULL;
-			char * offset_end = NULL;
-
-			for ( char *p = messages[i]; *p; ++p ) {
-				// find parantheses and +offset
-				if ( *p == '(' ) {
-					name = p;
-				}
-				else if ( *p == '+' ) {
-					offset_begin = p;
-				}
-				else if ( *p == ')' ) {
-					offset_end = p;
-					break;
-				}
-			}
-
-			// if line contains symbol print it
-			int frameNo = i - start;
-			if ( name && offset_begin && offset_end && name < offset_begin ) {
-				// delimit strings
-				*name++ = '\0';
-				*offset_begin++ = '\0';
-				*offset_end++ = '\0';
-
-				#ifdef __USE_STREAM__
-				serr 	| "("  | frameNo | ")" | messages[i] | ":"
-					| name | "+" | offset_begin | offset_end | endl;
-				#else
-				fprintf( stderr, "(%i) %s : %s + %s %s\n", frameNo, messages[i], name, offset_begin, offset_end);
-				#endif
-			}
-			// otherwise, print the whole line
-			else {
-				#ifdef __USE_STREAM__
-				serr | "(" | frameNo | ")" | messages[i] | endl;
-				#else
-				fprintf( stderr, "(%i) %s\n", frameNo, messages[i] );
-				#endif
-			}
-		}
-
-		free( messages );
-	}
-)
-
-// void sigHandler_segv( __CFA_SIGPARMS__ ) {
-// 	__cfaabi_dbg_debug_do(
-// 		#ifdef __USE_STREAM__
-// 		serr 	| "*CFA runtime error* program cfa-cpp terminated with"
-// 			| (sig == SIGSEGV ? "segment fault." : "bus error.")
-// 			| endl;
-// 		#else
-// 		fprintf( stderr, "*CFA runtime error* program cfa-cpp terminated with %s\n", sig == SIGSEGV ? "segment fault." : "bus error." );
-// 		#endif
-
-// 		// skip first 2 stack frames
-// 		__kernel_backtrace( 1 );
-// 	)
-// 	exit( EXIT_FAILURE );
-// }
-
-// void sigHandler_abort( __CFA_SIGPARMS__ ) {
-// 	// skip first 6 stack frames
-// 	__cfaabi_dbg_debug_do( __kernel_backtrace( 6 ); )
-
-// 	// reset default signal handler
-// 	__kernel_sigdefault( SIGABRT );
-
-// 	raise( SIGABRT );
-// }
-
 // Local Variables: //
 // mode: c //
Index: src/libcfa/concurrency/thread.c
===================================================================
--- src/libcfa/concurrency/thread.c	(revision 65deb18a7ffff4dccefdf2611afde3cadd19efb0)
+++ src/libcfa/concurrency/thread.c	(revision 7416d46ae4c80902ec659807c72c4b3d78cdba5c)
@@ -38,4 +38,9 @@
 	self_mon_p = &self_mon;
 	next = NULL;
+	__cfaabi_dbg_debug_do(
+		dbg_next = NULL;
+		dbg_prev = NULL;
+		__cfaabi_dbg_thread_register(&this);
+	)
 
 	monitors{ &self_mon_p, 1, (fptr_t)0 };
