Index: tests/concurrent/futures/basic.cfa
===================================================================
--- tests/concurrent/futures/basic.cfa	(revision 70cab4315819e6026deee69e49b58c9575cff047)
+++ tests/concurrent/futures/basic.cfa	(revision 70cab4315819e6026deee69e49b58c9575cff047)
@@ -0,0 +1,93 @@
+#include <thread.hfa>
+enum {NFUTURES = 10};
+
+thread Server {
+	int cnt;
+	future_t * requests[NFUTURES];
+};
+
+void ?{}( Server & this ) {
+	this.cnt = 0;
+	for(i; NFUTURES) {
+		this.requests[i] = 0p;
+	}
+}
+
+void ^?{}( Server & mutex this ) {
+	assert(this.cnt == 0);
+	for(i; NFUTURES) {
+		this.requests[i] = 0p;
+	}
+}
+
+void process( Server & this, int i ) {
+	if( this.requests[i] == 0p ) return;
+	future_t * f = this.requests[i];
+	this.requests[i] = 0p;
+	this.cnt--;
+	fulfil( *f );
+}
+
+void call( Server & mutex this, future_t & f ) {
+	for(i; NFUTURES) {
+		if( this.requests[i] == 0p ) {
+			this.requests[i] = &f;
+			this.cnt++;
+			return;
+		}
+	}
+	abort("Monitor Error");
+}
+
+void main( Server & this ) {
+	unsigned i = 0;
+	for() {
+		waitfor( ^?{} : this ) {
+			break;
+		}
+		or when( this.cnt < NFUTURES ) waitfor( call: this ) {}
+		or else {
+			process( this, i % NFUTURES );
+			i++;
+		}
+	}
+
+	for(i; NFUTURES) {
+		process( this, i );
+	}
+}
+
+Server * the_server;
+thread Worker {};
+
+void thrash(void) {
+	volatile int locals[250];
+	for(i; 250) {
+		locals[i] = 0xdeadbeef;
+	}
+}
+
+void work(void) {
+	future_t mine;
+	call( *the_server, mine );
+	wait( mine );
+}
+
+void main( Worker & ) {
+	for(150) {
+		thrash();
+		work();
+		thrash();
+	}
+}
+
+int main() {
+	processor procs[2];
+	{
+		Server server;
+		the_server = &server;
+		{
+			Worker workers[17];
+		}
+	}
+}
