Index: src/libcfa/concurrency/kernel.c
===================================================================
--- src/libcfa/concurrency/kernel.c	(revision 135b43118e38aa40c2f0cbfa16829e4b41313af7)
+++ src/libcfa/concurrency/kernel.c	(revision 6b224a52e644258a65fc4b1af5b45c5d9c835149)
@@ -73,97 +73,97 @@
 };
 
-void ?{}( current_stack_info_t * this ) {
-	CtxGet( this->ctx );
-	this->base = this->ctx.FP;
-	this->storage = this->ctx.SP;
+void ?{}( current_stack_info_t & this ) {
+	CtxGet( this.ctx );
+	this.base = this.ctx.FP;
+	this.storage = this.ctx.SP;
 
 	rlimit r;
 	getrlimit( RLIMIT_STACK, &r);
-	this->size = r.rlim_cur;
-
-	this->limit = (void *)(((intptr_t)this->base) - this->size);
-	this->context = &storage_mainThreadCtx;
-	this->top = this->base;
-}
-
-void ?{}( coStack_t * this, current_stack_info_t * info) {
-	this->size = info->size;
-	this->storage = info->storage;
-	this->limit = info->limit;
-	this->base = info->base;
-	this->context = info->context;
-	this->top = info->top;
-	this->userStack = true;
-}
-
-void ?{}( coroutine_desc * this, current_stack_info_t * info) {
-	(&this->stack){ info };
-	this->name = "Main Thread";
-	this->errno_ = 0;
-	this->state = Start;
-}
-
-void ?{}( thread_desc * this, current_stack_info_t * info) {
-	(&this->cor){ info };
+	this.size = r.rlim_cur;
+
+	this.limit = (void *)(((intptr_t)this.base) - this.size);
+	this.context = &storage_mainThreadCtx;
+	this.top = this.base;
+}
+
+void ?{}( coStack_t & this, current_stack_info_t * info) {
+	this.size = info->size;
+	this.storage = info->storage;
+	this.limit = info->limit;
+	this.base = info->base;
+	this.context = info->context;
+	this.top = info->top;
+	this.userStack = true;
+}
+
+void ?{}( coroutine_desc & this, current_stack_info_t * info) {
+	(this.stack){ info };
+	this.name = "Main Thread";
+	this.errno_ = 0;
+	this.state = Start;
+}
+
+void ?{}( thread_desc & this, current_stack_info_t * info) {
+	(this.cor){ info };
 }
 
 //-----------------------------------------------------------------------------
 // Processor coroutine
-void ?{}(processorCtx_t * this, processor * proc) {
-	(&this->__cor){ "Processor" };
-	this->proc = proc;
-	proc->runner = this;
-}
-
-void ?{}(processorCtx_t * this, processor * proc, current_stack_info_t * info) {
-	(&this->__cor){ info };
-	this->proc = proc;
-	proc->runner = this;
-}
-
-void ?{}(processor * this) {
+void ?{}(processorCtx_t & this, processor * proc) {
+	(this.__cor){ "Processor" };
+	this.proc = proc;
+	proc->runner = &this;
+}
+
+void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
+	(this.__cor){ info };
+	this.proc = proc;
+	proc->runner = &this;
+}
+
+void ?{}(processor & this) {
 	this{ mainCluster };
 }
 
-void ?{}(processor * this, cluster * cltr) {
-	this->cltr = cltr;
-	(&this->terminated){ 0 };
-	this->do_terminate = false;
-	this->preemption_alarm = NULL;
-	this->pending_preemption = false;
-
-	start( this );
-}
-
-void ?{}(processor * this, cluster * cltr, processorCtx_t * runner) {
-	this->cltr = cltr;
-	(&this->terminated){ 0 };
-	this->do_terminate = false;
-	this->preemption_alarm = NULL;
-	this->pending_preemption = false;
-	this->kernel_thread = pthread_self();
-
-	this->runner = runner;
-	LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", runner);
-	runner{ this };
-}
-
-void ^?{}(processor * this) {
-	if( ! this->do_terminate ) {
-		LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", this);
-		this->do_terminate = true;
-		P( &this->terminated );
-		pthread_join( this->kernel_thread, NULL );
-	}
-}
-
-void ?{}(cluster * this) {
-	( &this->ready_queue ){};
-	( &this->ready_queue_lock ){};
-
-	this->preemption = default_preemption();
-}
-
-void ^?{}(cluster * this) {
+void ?{}(processor & this, cluster * cltr) {
+	this.cltr = cltr;
+	(this.terminated){ 0 };
+	this.do_terminate = false;
+	this.preemption_alarm = NULL;
+	this.pending_preemption = false;
+
+	start( &this );
+}
+
+void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) {
+	this.cltr = cltr;
+	(this.terminated){ 0 };
+	this.do_terminate = false;
+	this.preemption_alarm = NULL;
+	this.pending_preemption = false;
+	this.kernel_thread = pthread_self();
+
+	this.runner = &runner;
+	LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", &runner);
+	runner{ &this };
+}
+
+void ^?{}(processor & this) {
+	if( ! this.do_terminate ) {
+		LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", &this);
+		this.do_terminate = true;
+		P( &this.terminated );
+		pthread_join( this.kernel_thread, NULL );
+	}
+}
+
+void ?{}(cluster & this) {
+	( this.ready_queue ){};
+	( this.ready_queue_lock ){};
+
+	this.preemption = default_preemption();
+}
+
+void ^?{}(cluster & this) {
 
 }
@@ -173,6 +173,6 @@
 //=============================================================================================
 //Main of the processor contexts
-void main(processorCtx_t * runner) {
-	processor * this = runner->proc;
+void main(processorCtx_t & runner) {
+	processor * this = runner.proc;
 
 	LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this);
@@ -219,5 +219,5 @@
 // from the processor coroutine to the target thread
 void runThread(processor * this, thread_desc * dst) {
-	coroutine_desc * proc_cor = get_coroutine(this->runner);
+	coroutine_desc * proc_cor = get_coroutine(*this->runner);
 	coroutine_desc * thrd_cor = get_coroutine(dst);
 
@@ -301,5 +301,5 @@
 	// appropriate stack.
 	proc_cor_storage.__cor.state = Active;
-	main( &proc_cor_storage );
+	main( proc_cor_storage );
 	proc_cor_storage.__cor.state = Halted;
 
@@ -443,5 +443,5 @@
 	mainThread = (thread_desc *)&storage_mainThread;
 	current_stack_info_t info;
-	mainThread{ &info };
+	(*mainThread){ &info };
 
 	LIB_DEBUG_PRINT_SAFE("Kernel : Main thread ready\n");
@@ -449,5 +449,5 @@
 	// Initialize the main cluster
 	mainCluster = (cluster *)&storage_mainCluster;
-	mainCluster{};
+	(*mainCluster){};
 
 	LIB_DEBUG_PRINT_SAFE("Kernel : main cluster ready\n");
@@ -456,5 +456,5 @@
 	// (the coroutine that contains the processing control flow)
 	mainProcessor = (processor *)&storage_mainProcessor;
-	mainProcessor{ mainCluster, (processorCtx_t *)&storage_mainProcessorCtx };
+	(*mainProcessor){ mainCluster, *(processorCtx_t *)&storage_mainProcessorCtx };
 
 	//initialize the global state variables
@@ -473,5 +473,5 @@
 	// context. Hence, the main thread does not begin through CtxInvokeThread, like all other threads. The trick here is that
 	// mainThread is on the ready queue when this call is made.
-	resume( mainProcessor->runner );
+	resume( *mainProcessor->runner );
 
 
@@ -501,5 +501,5 @@
 	// Destroy the main processor and its context in reverse order of construction
 	// These were manually constructed so we need manually destroy them
-	^(mainProcessor->runner){};
+	^(*mainProcessor->runner){};
 	^(mainProcessor){};
 
@@ -569,8 +569,8 @@
 //-----------------------------------------------------------------------------
 // Locks
-void ?{}( spinlock * this ) {
-	this->lock = 0;
-}
-void ^?{}( spinlock * this ) {
+void ?{}( spinlock & this ) {
+	this.lock = 0;
+}
+void ^?{}( spinlock & this ) {
 
 }
@@ -606,10 +606,10 @@
 }
 
-void  ?{}( semaphore * this, int count = 1 ) {
-	(&this->lock){};
-	this->count = count;
-	(&this->waiting){};
-}
-void ^?{}(semaphore * this) {}
+void  ?{}( semaphore & this, int count = 1 ) {
+	(this.lock){};
+	this.count = count;
+	(this.waiting){};
+}
+void ^?{}(semaphore & this) {}
 
 void P(semaphore * this) {
@@ -645,7 +645,7 @@
 //-----------------------------------------------------------------------------
 // Queues
-void ?{}( __thread_queue_t * this ) {
-	this->head = NULL;
-	this->tail = &this->head;
+void ?{}( __thread_queue_t & this ) {
+	this.head = NULL;
+	this.tail = &this.head;
 }
 
@@ -685,8 +685,6 @@
 }
 
-
-
-void ?{}( __condition_stack_t * this ) {
-	this->top = NULL;
+void ?{}( __condition_stack_t & this ) {
+	this.top = NULL;
 }
 
