Index: tests/io/comp_fair.cfa
===================================================================
--- tests/io/comp_fair.cfa	(revision 31ef26735f46b5359d660de018c9a7f84beea961)
+++ tests/io/comp_fair.cfa	(revision 1417f6b2c2ab63559e88f40687ed5ac6ce0c8b94)
@@ -16,5 +16,5 @@
 
 
-#include <concurrency/locks.hfa>
+#include <concurrency/barrier.hfa>
 #include <fstream.hfa>
 #include <iofwd.hfa>
@@ -27,5 +27,5 @@
 
 struct {
-      semaphore sem;
+      barrier & bar;
       int pipe[2];
 
@@ -59,6 +59,4 @@
 		yield();
 	}
-
-      mutex(sout) sout | "Spinner done";
 }
 
@@ -70,6 +68,4 @@
 
       for(TIMES) {
-		yield( prng( this, 15 ) );
-
             io_future_t f;
             if ( do_read ) {
@@ -80,5 +76,7 @@
             }
 
-            P( globals.sem );
+            block( globals.bar );
+
+		yield( prng( this, 15 ) );
 
             unsigned i = __atomic_add_fetch( &counter, 1, __ATOMIC_SEQ_CST );
@@ -89,9 +87,7 @@
             if(f.result < 0)
                   abort | "Read error" | -f.result | ":" | strerror(-f.result);
+
+            block( globals.bar );
       }
-
-      P( globals.sem );
-
-      mutex(sout) sout | "Reader done";
 }
 
@@ -102,7 +98,5 @@
 void main(Writer & this) {
       for(TIMES) {
-            yield( prng( this, 15 ) );
-
-            V( globals.sem );
+            block( globals.bar );
 
             sleep( 1`us );
@@ -113,7 +107,6 @@
                   abort | "Write error" | errno | ":" | strerror(errno);
 
+            block( globals.bar );
       }
-
-      mutex(sout) sout | "Writer done";
 }
 
@@ -126,9 +119,9 @@
 		yield();
 	}
-
-      mutex(sout) sout | "Yielder done";
 }
 
 int main() {
+      barrier bar = { 2 };
+      &globals.bar = &bar;
       int ret = pipe(globals.pipe);
       if(ret != 0)
