Index: uspace/lib/c/generic/futex.c
===================================================================
--- uspace/lib/c/generic/futex.c	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
+++ uspace/lib/c/generic/futex.c	(revision 5f36841fc8b62edea915fd8ce6977576d3f6520f)
@@ -80,5 +80,6 @@
 void __futex_lock(futex_t *futex, const char *name)
 {
-	/* We use relaxed atomics to avoid violating C11 memory model.
+	/*
+	 * We use relaxed atomics to avoid violating C11 memory model.
 	 * They should compile to regular load/stores, but simple assignments
 	 * would be UB by definition.
@@ -90,6 +91,7 @@
 	futex_down(futex);
 
-	void *prev_owner = __atomic_exchange_n(&futex->owner, self, __ATOMIC_RELAXED);
+	void *prev_owner = __atomic_load_n(&futex->owner, __ATOMIC_RELAXED);
 	assert(prev_owner == NULL);
+	__atomic_store_n(&futex->owner, self, __ATOMIC_RELAXED);
 
 	atomic_inc(&self->futex_locks);
