Index: tests/concurrent/semaphore.cfa
===================================================================
--- tests/concurrent/semaphore.cfa	(revision 172a88dde8e029b28393f7e8638a221601b50f35)
+++ tests/concurrent/semaphore.cfa	(revision 237df76db82f504ef572c9139c965eb7aa1bfcfb)
@@ -2,4 +2,5 @@
 #include <locks.hfa>
 #include <thread.hfa>
+#include <mutex_stmt.hfa>
 
 enum { num_blockers = 17, num_unblockers = 13 };
@@ -28,5 +29,5 @@
 		thrash();
 		P(ben);
-		if(((thread&)this).seqable.next != 0p) sout | acquire |"Link not invalidated";
+		if(((thread&)this).seqable.next != 0p) mutex(sout) sout | "Link not invalidated";
 		thrash();
 	}
Index: tests/concurrent/sleep.cfa
===================================================================
--- tests/concurrent/sleep.cfa	(revision 172a88dde8e029b28393f7e8638a221601b50f35)
+++ tests/concurrent/sleep.cfa	(revision 237df76db82f504ef572c9139c965eb7aa1bfcfb)
@@ -1,4 +1,5 @@
 #include <fstream.hfa>
 #include <thread.hfa>
+#include <mutex_stmt.hfa>
 #include <time.hfa>
 
@@ -29,5 +30,5 @@
 
 int main() {
-	sout | acquire | "start";
+	mutex( sout ) sout | "start";
 	{
 		slow_sleeper slow;
@@ -36,5 +37,5 @@
 		yield();
 	}
-	sout | acquire | "done";
+	mutex( sout ) sout | "done";
 }
 
Index: tests/io/io-acquire.cfa
===================================================================
--- tests/io/io-acquire.cfa	(revision 172a88dde8e029b28393f7e8638a221601b50f35)
+++ tests/io/io-acquire.cfa	(revision 237df76db82f504ef572c9139c965eb7aa1bfcfb)
@@ -10,10 +10,11 @@
 // Created On       : Mon Mar  1 18:40:09 2021
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr 27 11:49:34 2021
-// Update Count     : 18
+// Last Modified On : Wed Oct  6 18:04:58 2021
+// Update Count     : 72
 // 
 
 #include <fstream.hfa>
 #include <thread.hfa>
+#include <mutex_stmt.hfa>
 
 thread T {};
@@ -21,9 +22,8 @@
 	// output from parallel threads should not be scrambled
 
-	for ( 100 ) {										// local protection
-		sout | acquire | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
+	for ( 100 ) {										// expression protection
+		mutex(sout) sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
 	}
-	{													// global protection (RAII)
-		osacquire acq = { sout };
+	mutex( sout ) {										// statement protection
 		for ( 100 ) {
 			sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
@@ -31,9 +31,17 @@
 	}
 	{													// duplicate protection demonstrating recursive lock
-		osacquire acq = { sout };
-		for ( 100 ) {
-			osacquire acq = { sout };
-			sout | acquire | 1 | 2 | 3 | 4 | 5 | acquire | 6 | 7 | 8 | 9;
-			sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
+		ofstream & h1( ofstream & os ) {				// helper
+			mutex( os ) return os | 1 | 2 | 3 | 4;		// unnecessary mutex
+		}
+		ofstream & h2( ofstream & os ) {				// helper
+			mutex( os ) return os | 6 | 7 | 8 | 9;		// unnecessary mutex
+		}
+		mutex( sout ) {									// unnecessary mutex
+			for ( 100 ) {
+				mutex( sout ) {
+					sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
+					sout | h1 | 5 | h2;					// refactored code
+				}
+			}
 		}
 	}
@@ -42,9 +50,8 @@
 
 	int a, b, c, d, e, f, g, h, i;
-	for ( 100 ) {										// local protection
-		sin | acquire | a | b | c | d | e | f | g | h | i;
+	for ( 100 ) {										// expression protection
+		mutex(sin) sin | a | b | c | d | e | f | g | h | i;
 	}
-	{													// global protection (RAII)
-		isacquire acq = { sin };
+	mutex( sin ) {										// statement protection
 		for ( 100 ) {
 			sin  | a | b | c | d | e | f | g | h | i;
@@ -52,9 +59,17 @@
 	}
 	{													// duplicate protection demonstrating recursive lock
-		isacquire acq = { sin };
-		for ( 100 ) {
-			isacquire acq = { sin };
-			sin | acquire | a | b | c | d | e | acquire | f | g | h | i;
-			sin | a | b | c | d | e | f | g | h | i;
+		ifstream & h1( ifstream & is ) {				// helper
+			mutex( is ) return is | a | b | c | d;		// unnecessary mutex
+		}
+		ifstream & h2( ifstream & is ) {				// helper
+			mutex( is ) return is | f | g | h | i;		// unnecessary mutex
+		}
+		mutex( sin ) {									// unnecessary mutex
+			for ( 5 ) {
+				mutex( sin ) {
+					sin  | a | b | c | d | e | f | g | h | i;
+					sin  | h1 | e | h2;					// refactored code
+				}
+			}
 		}
 	}
Index: tests/linking/io-acquire.cfa
===================================================================
--- tests/linking/io-acquire.cfa	(revision 172a88dde8e029b28393f7e8638a221601b50f35)
+++ tests/linking/io-acquire.cfa	(revision 237df76db82f504ef572c9139c965eb7aa1bfcfb)
@@ -17,12 +17,13 @@
 #include <fstream.hfa>
 #include <stdlib.hfa>
+#include <mutex_stmt.hfa>
 
 int main() {
 	int i;
 	if(threading_enabled()) {
-		stdout | acquire | "YES";
+		mutex( stdout ) stdout | "YES";
 		stdin | i;
 	} else {
-		stdout | acquire | "NO";
+		mutex( stdout ) stdout | "NO";
 		stdin | i;
 	}
