Index: libcfa/src/concurrency/io.cfa
===================================================================
--- libcfa/src/concurrency/io.cfa	(revision 98d1b90b045a68a7489e5600d3622bfe2d876b7e)
+++ libcfa/src/concurrency/io.cfa	(revision 14d5461bd8249ca8eed61c3efb54245a34802a41)
@@ -93,12 +93,10 @@
 	extern void __kernel_unpark( thread$ * thrd, unpark_hint );
 
-	bool __cfa_io_drain( processor * proc ) {
+	bool __cfa_io_drain( $io_context * ctx ) {
 		/* paranoid */ verify( ! __preemption_enabled() );
 		/* paranoid */ verify( ready_schedule_islocked() );
-		/* paranoid */ verify( proc );
-		/* paranoid */ verify( proc->io.ctx );
+		/* paranoid */ verify( ctx );
 
 		// Drain the queue
-		$io_context * ctx = proc->io.ctx;
 		unsigned head = *ctx->cq.head;
 		unsigned tail = *ctx->cq.tail;
@@ -110,4 +108,8 @@
 		if(count == 0) return false;
 
+		if(!__atomic_try_acquire(&ctx->cq.lock)) {
+			return false;
+		}
+
 		for(i; count) {
 			unsigned idx = (head + i) & mask;
@@ -130,4 +132,6 @@
 		/* paranoid */ verify( ready_schedule_islocked() );
 		/* paranoid */ verify( ! __preemption_enabled() );
+
+		__atomic_unlock(&ctx->cq.lock);
 
 		return true;
@@ -179,5 +183,5 @@
 
 		ready_schedule_lock();
-		bool ret = __cfa_io_drain( proc );
+		bool ret = __cfa_io_drain( &ctx );
 		ready_schedule_unlock();
 		return ret;
Index: libcfa/src/concurrency/io/setup.cfa
===================================================================
--- libcfa/src/concurrency/io/setup.cfa	(revision 98d1b90b045a68a7489e5600d3622bfe2d876b7e)
+++ libcfa/src/concurrency/io/setup.cfa	(revision 14d5461bd8249ca8eed61c3efb54245a34802a41)
@@ -214,4 +214,5 @@
 
 		// completion queue
+		cq.lock      = 0;
 		cq.head      = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.head);
 		cq.tail      = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.tail);
Index: libcfa/src/concurrency/io/types.hfa
===================================================================
--- libcfa/src/concurrency/io/types.hfa	(revision 98d1b90b045a68a7489e5600d3622bfe2d876b7e)
+++ libcfa/src/concurrency/io/types.hfa	(revision 14d5461bd8249ca8eed61c3efb54245a34802a41)
@@ -78,4 +78,6 @@
 
 	struct __cmp_ring_t {
+		volatile bool lock;
+
 		// Head and tail of the ring
 		volatile __u32 * head;
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 98d1b90b045a68a7489e5600d3622bfe2d876b7e)
+++ libcfa/src/concurrency/kernel.cfa	(revision 14d5461bd8249ca8eed61c3efb54245a34802a41)
@@ -136,5 +136,5 @@
 static void mark_awake(__cluster_proc_list & idles, processor & proc);
 
-extern bool __cfa_io_drain( processor * );
+extern bool __cfa_io_drain( $io_context * );
 extern bool __cfa_io_flush( processor *, int min_comp );
 static inline bool __maybe_io_drain( processor * );
@@ -839,5 +839,5 @@
 		if(head == tail) return false;
 		ready_schedule_lock();
-		ret = __cfa_io_drain( proc );
+		ret = __cfa_io_drain( ctx );
 		ready_schedule_unlock();
 	#endif
