Index: tests/concurrency/waituntil/.expect/all_types.txt
===================================================================
--- tests/concurrency/waituntil/.expect/all_types.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/all_types.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,6 @@
+start
+terminating churner
+waiting for empty channels
+sending sentinels
+joining servers
+done
Index: tests/concurrency/waituntil/.expect/basic_else.txt
===================================================================
--- tests/concurrency/waituntil/.expect/basic_else.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/basic_else.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,5 @@
+else1
+A2
+else3
+A4
+A5
Index: tests/concurrency/waituntil/.expect/channel_close.txt
===================================================================
--- tests/concurrency/waituntil/.expect/channel_close.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/channel_close.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,10 @@
+start OR
+done sleep
+closing A
+closing B
+done
+start AND
+done sleep
+closing A
+closing B
+done
Index: tests/concurrency/waituntil/.expect/channel_zero_size.txt
===================================================================
--- tests/concurrency/waituntil/.expect/channel_zero_size.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/channel_zero_size.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,4 @@
+start
+sending sentinels
+joining servers
+done
Index: tests/concurrency/waituntil/.expect/channels.txt
===================================================================
--- tests/concurrency/waituntil/.expect/channels.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/channels.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,6 @@
+start
+terminating churner
+waiting for empty channels
+sending sentinels
+joining servers
+done
Index: tests/concurrency/waituntil/.expect/futures.txt
===================================================================
--- tests/concurrency/waituntil/.expect/futures.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/futures.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,2 @@
+start
+end
Index: tests/concurrency/waituntil/.expect/locks.txt
===================================================================
--- tests/concurrency/waituntil/.expect/locks.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/locks.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,6 @@
+start
+DONE
+DONE
+DONE
+start recursive acq test
+done
Index: tests/concurrency/waituntil/.expect/one_chan.txt
===================================================================
--- tests/concurrency/waituntil/.expect/one_chan.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/one_chan.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,5 @@
+start
+waiting for empty channels
+sending sentinels
+joining servers
+done
Index: tests/concurrency/waituntil/.expect/timeout.txt
===================================================================
--- tests/concurrency/waituntil/.expect/timeout.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/.expect/timeout.txt	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,6 @@
+timeout
+timeout
+else
+timeout
+timeout
+done
Index: tests/concurrency/waituntil/all_types.cfa
===================================================================
--- tests/concurrency/waituntil/all_types.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/all_types.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,119 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+#include <locks.hfa>
+#include <future.hfa>
+#include <mutex_stmt.hfa>
+
+future( long long int ) F;
+const long long int val_to_deliver = 42;
+
+channel(long long int) A, C;
+
+multiple_acquisition_lock B;
+volatile long long int b_val = 0;
+volatile long long int old_b_val = -1;
+
+volatile bool done = false;
+long long int globalTotal = 0;
+
+void consume_b_val( long long int & myTotal ) {
+    if ( b_val != old_b_val ) {
+        myTotal += b_val;
+        old_b_val++;
+    }
+}
+
+void produce_b_val( long long int & myTotal ) {
+    if ( b_val == old_b_val ) {
+        myTotal += b_val;
+        b_val++;
+    }
+}
+
+thread Server1 {};
+void main( Server1 & this ) {
+    long long int a, b, c, i = 0, myTotal = 0;
+    for( ;;i++ ) {
+        when( i % 2 == 0 ) waituntil( a << A ) { myTotal += a; }
+        or when( i % 4 < 2 ) waituntil( B ) { consume_b_val( myTotal ); }
+        or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; }
+        or when( i % 3 ) waituntil( timeout( 1`ms ) ) {}
+        or when( i % 8 < 4 ) else {}
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+thread Drainer {}; // ensures that the changing when states of Server1 don't result in a deadlock
+void main( Drainer & this ) {
+    long long int a, b, c, myTotal = 0;
+    for( ;; ) {
+        waituntil( F ) { myTotal += get(F); reset( F ); }
+        or waituntil( a << A ) { myTotal += a; }
+        or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; }
+        or waituntil( B ) { consume_b_val( myTotal ); }
+        or waituntil( timeout( 100`ns ) ) { }
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+thread Churner {}; // performs non-waituntil try insert/remove operations to add churn/interference
+void main( Churner & this ) {
+    long long int out, myTotal = 0;
+    bool success;
+    while( !done ) {
+        try_insert( A, 0 );
+        if ( try_lock( B ) ) {
+            consume_b_val( myTotal );
+            unlock( B );
+        }
+        mutex( B ) { consume_b_val( myTotal ); }
+        try_insert( C, 0 );
+        [out, success] = try_remove( A );
+        if ( success ) myTotal += out;
+        [out, success] = try_remove( C );
+        if ( success ) myTotal += out;
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+size_t numtimes = 5000;
+size_t numServers = 3;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        numtimes = atoi( argv[1] );
+
+    processor p[numServers + 2];
+    A{5};
+    C{5};
+
+    long long int total = 0;
+    printf("start\n");
+    {
+        Server1 s[numServers];
+        Drainer d;
+        {
+            Churner c;
+            for( long long int j = 0; j < numtimes; j++ ) {
+                when( j % 2 == 0 ) waituntil( j >> A ) { total += j; }
+                or when( j % 4 < 2 ) waituntil( B ) { produce_b_val( total ); }
+                and when( j % 8 < 4 ) waituntil( j >> C ) { total += j; }
+                and waituntil( timeout( 1`ns ) ) {}
+                if ( j == numtimes / 2 )
+                    fulfil( F, val_to_deliver );
+            }
+            done = true;
+            printf("terminating churner\n");
+        }
+        printf("waiting for empty channels\n");
+        while( get_count( A ) > 0 || get_count( C ) > 0 ) { }
+        printf("sending sentinels\n");
+        for ( i; numServers + 1 ) insert( C, -1 );
+        printf("joining servers\n");
+    }
+    if ( b_val == old_b_val ) total += b_val;       // handle if last value wasn't produced
+    if ( !available( F ) ) total += val_to_deliver; // handle if future was consumed
+    if ( total != globalTotal ) 
+        printf("CHECKSUM MISMATCH!! Main thread got %lld, server sum is %lld\n", total, globalTotal);
+    printf("done\n");
+}
Index: tests/concurrency/waituntil/basic_else.cfa
===================================================================
--- tests/concurrency/waituntil/basic_else.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/basic_else.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,17 @@
+#include <select.hfa>
+#include <future.hfa>
+
+future(int) A, B, C;
+
+int main() {
+    waituntil( A ) { printf("A1\n"); } or else { printf("else1\n"); }
+    fulfil( A, 1 );
+    waituntil( A ) { printf("A2\n"); } or else { printf("else2\n"); }
+    reset( A );
+    waituntil( A ) { printf("A3\n"); } or when(true) else { printf("else3\n"); }
+    fulfil( A, 1 );
+    waituntil( A ) { printf("A4\n"); } or when(false) else { printf("else4\n"); }
+    reset( A );
+    fulfil( A, 1 );
+    waituntil( A ) { printf("A5\n"); }
+}
Index: tests/concurrency/waituntil/channel_close.cfa
===================================================================
--- tests/concurrency/waituntil/channel_close.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/channel_close.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,94 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+#include <time.hfa>
+
+channel(long long int) A, B;
+
+volatile long long int inserts = 0;
+volatile long long int removes = 0;
+
+thread Producer {};
+void main( Producer & this ) {
+    try {
+        for( long long int i = 0;;i++ ) {
+            waituntil( (i >> A) ) { inserts++; }
+            and waituntil( (i >> B) ) { inserts++; }
+        }
+    } catch ( channel_closed * e ) {} 
+}
+
+bool useAnd = false;
+thread Consumer {}; // ensures that the changing when states of Server1 don't result in a deadlock
+void main( Consumer & this ) {
+    long long int in, in2, A_removes = 0, B_removes = 0;
+    try {
+        for( ;; ) {
+            if ( useAnd ) {
+                waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
+                and waituntil( (in2 << B) ) { assert( B_removes == in2 ); B_removes++; removes++; }
+                continue;
+            }
+            waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
+            or waituntil( (in2 << B) ) { assert( B_removes == in2 ); B_removes++; removes++; }
+        }
+    } catchResume ( channel_closed * e ) {} // continue to remove until would block
+    catch ( channel_closed * e ) {} 
+    try {
+        for( ;; )
+            waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
+    } catchResume ( channel_closed * e ) {} // continue to remove until would block
+    catch ( channel_closed * e ) {} 
+    try {
+        for( ;; )
+            waituntil( (in << B) ) { assert( B_removes == in ); B_removes++; removes++; }
+    } catchResume ( channel_closed * e ) {} // continue to remove until would block
+    catch ( channel_closed * e ) {} 
+}
+
+
+size_t time = 5;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        time = atoi( argv[1] );
+
+    processor p[2];
+    A{5};
+    B{5};
+
+    printf("start OR\n");
+    {
+        Producer p;
+        Consumer c;
+        sleep(time`s);
+        printf("done sleep\n");
+        printf("closing A\n");
+        close(A);
+        printf("closing B\n");
+        close(B);
+    }
+    if ( inserts != removes ) 
+        printf("CHECKSUM MISMATCH!! Producer got: %lld, Consumer got: %lld\n", inserts, removes);
+    printf("done\n");
+    ^A{};
+    ^B{};
+
+    inserts = 0;
+    removes = 0;
+    A{5};
+    B{5};
+    printf("start AND\n");
+    {
+        Producer p;
+        Consumer c;
+        sleep(time`s);
+        printf("done sleep\n");
+        printf("closing A\n");
+        close(A);
+        printf("closing B\n");
+        close(B);
+    }
+    if ( inserts != removes ) 
+        printf("CHECKSUM MISMATCH!! Producer got: %lld, Consumer got: %lld\n", inserts, removes);
+    printf("done\n");
+}
Index: tests/concurrency/waituntil/channel_zero_size.cfa
===================================================================
--- tests/concurrency/waituntil/channel_zero_size.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/channel_zero_size.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,50 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+
+channel(long long int) A, B, C;
+
+volatile bool done = false;
+long long int globalTotal = 0;
+
+thread Server1 {};
+void main( Server1 & this ) {
+    long long int a, b, c, i = 0, myTotal = 0;
+    for( ;;i++ ) {
+        // printf("loop S\n");
+        waituntil( a << A ) { myTotal += a; }
+        or waituntil( b << B ) { myTotal += b; }
+        or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; }
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+size_t numtimes = 100000;
+size_t numServers = 1;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        numtimes = atoi( argv[1] );
+
+    processor p[numServers];
+    A{0};
+    B{0};
+    C{0};
+
+    long long int total = 0;
+    printf("start\n");
+    {
+        Server1 s[numServers];
+        for( long long int j = 0; j < numtimes; j++ ) {
+            // printf("loop\n");
+            waituntil( j >> A ) { total += j; }
+            or waituntil( j >> B ) { total += j; }
+            or waituntil( j >> C ) { total += j; }
+        }
+        printf("sending sentinels\n");
+        for ( i; numServers ) insert( C, -1 );
+        printf("joining servers\n");
+    }
+    if ( total != globalTotal ) 
+        printf("CHECKSUM MISMATCH!! Main thread got %lld, server sum is %lld\n", total, globalTotal);
+    printf("done\n");
+}
Index: tests/concurrency/waituntil/channels.cfa
===================================================================
--- tests/concurrency/waituntil/channels.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/channels.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,87 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+
+channel(long long int) A, B, C;
+
+volatile bool done = false;
+long long int globalTotal = 0;
+
+thread Server1 {};
+void main( Server1 & this ) {
+    long long int a, b, c, i = 0, myTotal = 0;
+    for( ;;i++ ) {
+        when( i % 2 == 0 ) waituntil( a << A ) { myTotal += a; }
+        or when( i % 4 < 2 ) waituntil( b << B ) { myTotal += b; }
+        or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; }
+        or when( i % 8 < 4 ) else {}
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+thread Drainer {}; // ensures that the changing when states of Server1 don't result in a deadlock
+void main( Drainer & this ) {
+    long long int a, b, c, myTotal = 0;
+    for( ;; ) {
+        waituntil( a << A ) { myTotal += a; }
+        or waituntil( b << B ) { myTotal += b; }
+        or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; }
+        or else {}
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+thread Churner {}; // performs non-waituntil try insert/remove operations to add churn/interference
+void main( Churner & this ) {
+    long long int out, myTotal = 0;
+    bool success;
+    while( !done ) {
+        try_insert( A, 0 );
+        try_insert( B, 0 );
+        try_insert( C, 0 );
+        [out, success] = try_remove( A );
+        if ( success ) myTotal += out;
+        [out, success] = try_remove( B );
+        if ( success ) myTotal += out;
+        [out, success] = try_remove( C );
+        if ( success ) myTotal += out;
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+size_t numtimes = 100000;
+size_t numServers = 3;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        numtimes = atoi( argv[1] );
+
+    processor p[numServers + 2];
+    A{5};
+    B{5};
+    C{5};
+
+    long long int total = 0;
+    printf("start\n");
+    {
+        Server1 s[numServers];
+        Drainer d;
+        {
+            Churner c;
+            for( long long int j = 0; j < numtimes; j++ ) {
+                when( j % 2 == 0 ) waituntil( j >> A ) { total += j; }
+                or when( j % 4 < 2 ) waituntil( j >> B ) { total += j; }
+                and when( j % 8 < 4 ) waituntil( j >> C ) { total += j; }
+            }
+            done = true;
+            printf("terminating churner\n");
+        }
+        printf("waiting for empty channels\n");
+        while( get_count( A ) > 0 || get_count( B ) > 0 || get_count( C ) > 0 ) { }
+        printf("sending sentinels\n");
+        for ( i; numServers + 1 ) insert( C, -1 );
+        printf("joining servers\n");
+    }
+    if ( total != globalTotal ) 
+        printf("CHECKSUM MISMATCH!! Main thread got %lld, server sum is %lld\n", total, globalTotal);
+    printf("done\n");
+}
Index: tests/concurrency/waituntil/futures.cfa
===================================================================
--- tests/concurrency/waituntil/futures.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/futures.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,61 @@
+#include <select.hfa>
+#include <future.hfa>
+#include <thread.hfa>
+
+future(int) A, B, C;
+
+semaphore s{0};
+
+thread Server1 {};
+void main( Server1 & this ) {
+    fulfil(B, 3);
+    P( s );
+    fulfil(A, 2);
+    fulfil(C, 4);
+}
+
+thread Server2 {};
+void main( Server2 & this ) {
+    fulfil(B, 6);
+    fulfil(A, 5);
+    fulfil(C, 7);
+}
+
+int main() {
+    processor proc[1];
+    printf("start\n"); // currently not working
+    {
+        Server1 s1;
+        waituntil( A ) { get(A); }
+        or waituntil( B ) { get(B); V( s ); }
+        and waituntil( C ) { get(C); }
+    }
+    reset(A);
+    reset(B);
+    reset(C);
+    for ( int i = 0; i < 8; i++ ) {
+        {
+            Server2 s2;
+            when( i % 2 == 0 ) waituntil( A ) { get(A); }
+            or when( i % 4 < 2 ) waituntil( B ) { get(B); }
+            and when( i < 4 ) waituntil( C ) { get(C); }
+        }
+        reset(A);
+        reset(B);
+        reset(C);
+        {
+            Server2 s2;
+            (
+                when( i % 2 == 0 ) waituntil( A ) { get(A); }
+                or when( i % 4 < 2 ) waituntil( B ) { get(B); }
+            )
+            and when( i < 4 ) waituntil( C ) { get(C); }
+        }
+        reset(A);
+        reset(B);
+        reset(C);
+    }
+
+    printf("end\n");
+    return 0;
+}
Index: tests/concurrency/waituntil/locks.cfa
===================================================================
--- tests/concurrency/waituntil/locks.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/locks.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,73 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <locks.hfa>
+#include <mutex_stmt.hfa>
+
+multiple_acquisition_lock A;
+simple_owner_lock B;
+simple_owner_lock C;
+
+volatile bool done = false;
+
+thread Server1 {};
+void main( Server1 & this ) {
+    while( !done ) {
+        lock(A);
+        unlock(A);
+        lock(B);
+        unlock(B);
+        lock(C);
+        unlock(C);
+        mutex(A,B,C) {};
+    }
+    mutex(sout) sout | "DONE";
+}
+
+size_t numtimes = 10000;
+int main() {
+    processor p[3];
+    int a = 0, b = 0, c = 0;
+    printf("start\n");
+    {
+        Server1 s[3];
+        for( j; numtimes ) {
+            for ( int i = 0; i < 8; i++ ) {
+
+                when( i % 2 == 0 ) waituntil( A ) { a++; }
+                or when( i % 4 < 2 ) waituntil( B ) { b++; }
+                and when( i < 4 ) waituntil( C ) { c++; }
+
+                (
+                    when( i % 2 == 0 ) waituntil( A ) { a++; }
+                    or when( i % 4 < 2 ) waituntil( B ) { b++; }
+                )
+                and when( i < 4 ) waituntil( C ) { c++; }
+                
+                when( i % 2 == 0 ) waituntil( A ) { a++; }
+                and when( i % 4 < 2 ) waituntil( B ) { b++; }
+                and when( i < 4 ) waituntil( C ) { c++; }
+
+                when( i % 2 == 0 ) waituntil( A ) { a++; }
+                or when( i % 4 < 2 ) waituntil( B ) { b++; }
+                or when( i < 4 ) waituntil( C ) { c++; }
+            }
+        }
+        done = true;
+    }
+    printf("start recursive acq test\n");
+    {
+        for( j; 10 ) {
+            lock( A );
+            lock( B );
+        }
+        for ( j; 10 ) {
+            waituntil( A ) { a++; } or waituntil( B ) { b++; }
+            waituntil( B ) { b++; } or waituntil( A ) { a++; }
+        }
+        for( j; 10 ) {
+            unlock( A );
+            unlock( B );
+        }
+    }
+    printf("done\n");
+}
Index: tests/concurrency/waituntil/one_chan.cfa
===================================================================
--- tests/concurrency/waituntil/one_chan.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/one_chan.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,44 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+
+channel(long long int) C;
+
+volatile bool done = false;
+long long int globalTotal = 0;
+
+thread Server1 {};
+void main( Server1 & this ) {
+    long long int c, i = 0, myTotal = 0;
+    for( ;;i++ ) {
+        waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; }
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+size_t numtimes = 100000;
+size_t numServers = 1;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        numtimes = atoi( argv[1] );
+
+    processor p[numServers];
+    C{5};
+
+    long long int total = 0;
+    printf("start\n");
+    {
+        Server1 s[numServers];
+        for( long long int j = 0; j < numtimes; j++ ) {
+            waituntil( j >> C ) { total += j; }
+        }
+        printf("waiting for empty channels\n");
+        printf("sending sentinels\n");
+        for ( i; numServers ) insert( C, -1 );
+        printf("joining servers\n");
+    }
+    assert(get_count( C ) == 0);
+    if ( total != globalTotal ) 
+        printf("CHECKSUM MISMATCH!! Main thread got %lld, server sum is %lld\n", total, globalTotal);
+    printf("done\n");
+}
Index: tests/concurrency/waituntil/timeout.cfa
===================================================================
--- tests/concurrency/waituntil/timeout.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
+++ tests/concurrency/waituntil/timeout.cfa	(revision c26bea2aa0f87b4b070349c5801adc32fb0d4cf9)
@@ -0,0 +1,18 @@
+#include <time.hfa>
+#include <alarm.hfa>
+#include <select.hfa>
+#include <stdbool.h>
+#include <stdio.h>
+
+int main() {
+    waituntil( sleep( 1`ms ) ) { printf("timeout\n"); }
+    waituntil( timeout( 1`s ) ) { printf("timeout\n"); } or waituntil( timeout( 2`s ) ) { printf("timeout\n"); }
+    waituntil( timeout( 100`s ) ) { printf("timeout 1\n"); } or else { printf("else\n"); }
+    waituntil( timeout( 1`ns ) ) { printf("timeout\n"); } and waituntil( timeout( 2`s ) ) { printf("timeout\n"); }
+    int count = 0;
+    for ( i; 1000 )
+        waituntil( timeout( 1`ns ) ) { count++; } or else { count++; }
+
+    assert( count == 1000 );
+    printf("done\n");
+}
