Index: tests/concurrent/.expect/join.txt
===================================================================
--- tests/concurrent/.expect/join.txt	(revision 0dbecad34ab30d97358958018da3ecb4409e1382)
+++ tests/concurrent/.expect/join.txt	(revision 0dbecad34ab30d97358958018da3ecb4409e1382)
@@ -0,0 +1,2 @@
+All workers got 42
+All other workers got 27
Index: tests/concurrent/join.cfa
===================================================================
--- tests/concurrent/join.cfa	(revision 0dbecad34ab30d97358958018da3ecb4409e1382)
+++ tests/concurrent/join.cfa	(revision 0dbecad34ab30d97358958018da3ecb4409e1382)
@@ -0,0 +1,52 @@
+#include <fstream.hfa>
+#include <thread.hfa>
+
+thread Worker { volatile int result; };
+
+void main(Worker & this) {
+	this.result = -10;
+	for(50) {
+		yield();
+	}
+	this.result = 42;
+}
+
+thread OtherWorker { volatile int result; };
+
+void main(OtherWorker & this) {
+	this.result = -10;
+	LOOP: for() {
+		waitfor( ^?{} : this) {
+			break LOOP;
+		}
+		or else {
+			yield();
+		}
+	}
+	this.result = 27;
+}
+
+
+int main(int argc, char* argv[]) {
+	{
+		Worker workers[17];
+		for(i; 17) {
+			int res = join( workers[i] ).result;
+			if( res != 42 ) {
+				sout | "Worker" | i | "got incorrect result:" | res;
+			}
+		}
+	}
+	sout | "All workers got 42";
+
+	{
+		OtherWorker workers[17];
+		for(i; 17) {
+			int res = join( workers[i] ).result;
+			if( res != 27 ) {
+				sout | "Other Worker" | i | "got incorrect result:" | res;
+			}
+		}
+	}
+	sout | "All other workers got 27";
+}
Index: tests/concurrent/joinerror.cfa
===================================================================
--- tests/concurrent/joinerror.cfa	(revision 0dbecad34ab30d97358958018da3ecb4409e1382)
+++ tests/concurrent/joinerror.cfa	(revision 0dbecad34ab30d97358958018da3ecb4409e1382)
@@ -0,0 +1,61 @@
+#include <fstream.hfa>
+#include <thread.hfa>
+
+thread Worker { volatile int result; };
+
+void main(Worker & this) {
+	this.result = -10;
+	for(50) {
+		yield();
+	}
+	this.result = 42;
+}
+
+int get_result( Worker & mutex this ) {
+	return this.result;
+}
+
+thread OtherWorker { volatile int result; };
+
+void main(OtherWorker & this) {
+	this.result = -10;
+	LOOP: for() {
+		waitfor( ^?{} : this) {
+			break LOOP;
+		}
+		or else {
+			yield();
+		}
+	}
+	this.result = 27;
+}
+
+int get_result( OtherWorker & mutex this ) {
+	return this.result;
+}
+
+int main(int argc, char* argv[]) {
+	{
+		Worker workers[17];
+		for(i; 17) {
+			join( workers[i] );
+			int res = get_result( workers[i] );
+			if( res != 42 ) {
+				sout | "Worker" | i | "got incorrect result:" | res;
+			}
+		}
+	}
+	sout | "All workers got 42";
+
+	{
+		OtherWorker workers[17];
+		for(i; 17) {
+			join( workers[i] );
+			int res = get_result( workers[i] );
+			if( res != 27 ) {
+				sout | "Other Worker" | i | "got incorrect result:" | res;
+			}
+		}
+	}
+	sout | "All other workers got 27";
+}
