Index: doc/theses/colby_parsons_MMAth/text/waituntil.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/text/waituntil.tex	(revision 210c7379c97a824c2ee7f5e3a7ba500aa7d4deee)
+++ doc/theses/colby_parsons_MMAth/text/waituntil.tex	(revision d5f5eb7a8c568f6ce552ed2e4d4807da21172373)
@@ -175,5 +175,5 @@
 
 \begin{lrbox}{\myboxA}
-\begin{lstlisting}[language=go,literate=]
+\begin{lstlisting}[language=go,literate=,{moredelim={**[is][\color{red}]{@}{@}}}]
 insert := make( chan int )
 remove := make( chan * int )
@@ -182,40 +182,36 @@
 count := 0
 func in_buf( int val ) {
-    buffer <- val
-    count++
+	buffer <- val
+	count++
 }
 func out_buf( int * ptr ) {
-    *ptr := <-buffer
-    count--
+	*ptr := <-buffer
+	count--
 }
 func BoundedBuffer {
-    L: for {
-        if ( count < Size && count > 0 ) {
-            select { // wait for message
-                case i := <- insert: in_buf( i )
-                case p := <- remove: out_buf( p )
-                case <- done: break L
-            }
-        } else if ( count < Size ) {
-            select { // wait for message
-                case i := <- insert: in_buf( i )
-                case <- done: break L
-            }
-        } else ( count > 0 ) {
-            select { // wait for message
-                case p := <- remove: out_buf( p )
-                case <- done: break L;
-            }
-        }
-    }
-    done <- 0
+	L: for {
+		if ( count < Size && count > 0 ) {
+			select { // wait for message
+				@case i := <- insert: in_buf( i )@
+				@case p := <- remove: out_buf( p )@
+				case <- done: break L
+			}
+		} else if ( count < Size ) {
+			select { // wait for message
+				@case i := <- insert: in_buf( i )@
+				case <- done: break L
+			}
+		} else ( count > 0 ) {
+			select { // wait for message
+				@case p := <- remove: out_buf( p )@
+				case <- done: break L;
+			}
+		}
+	}
+	done <- 0
 }
 func main() {
 	go BoundedBuffer() // start administrator
 }
-
-
-
-
 \end{lstlisting}
 \end{lrbox}
@@ -223,19 +219,31 @@
 \begin{lrbox}{\myboxB}
 \begin{lstlisting}[language=uC++,{moredelim={**[is][\color{red}]{@}{@}}}]
+
+
+
+
+
+
+
+
+
+
+
+
 _Task BoundedBuffer {
 	int * buffer;
 	int front = back = count = 0;
   public:
-    // ... constructor implementation
+	// ... constructor implementation
 	void insert( int elem ) {
 		buffer[front] = elem;
-        front = ( front + 1 ) % Size;
+		front = ( front + 1 ) % Size;
 		count += 1;
 	}
 	int remove() {
 		int ret = buffer[back];
-        back = ( back + 1 ) % Size;
+		back = ( back + 1 ) % Size;
 		count -= 1;
-        return ret;
+		return ret;
 	}
   private:
@@ -636,25 +644,25 @@
 \begin{cfa}
 bool pending_set_other( select_node & other, select_node & mine ) {
-    unsigned long int cmp_status = UNSAT;
-
-    // Try to set other status, if we succeed break and return true
-    while( ! CAS( other.clause_status, &cmp_status, SAT ) ) {
-        if ( cmp_status == SAT )
-            return false; // If other status is SAT we lost so return false
-
-        // Toggle own status flag to allow other thread to potentially win
-        mine.status = UNSAT;
-
-        // Reset compare flag
-        cmp_status = UNSAT;
-
-        // Attempt to set own status flag back to PENDING to retry
-        if ( ! CAS( mine.clause_status, &cmp_status, PENDING ) )
-            return false; // If we fail then we lost so return false
-        
-        // Reset compare flag
-        cmp_status = UNSAT;
-    }
-    return true;
+	unsigned long int cmp_status = UNSAT;
+
+	// Try to set other status, if we succeed break and return true
+	while( ! CAS( other.clause_status, &cmp_status, SAT ) ) {
+		if ( cmp_status == SAT )
+			return false; // If other status is SAT we lost so return false
+
+		// Toggle own status flag to allow other thread to potentially win
+		mine.status = UNSAT;
+
+		// Reset compare flag
+		cmp_status = UNSAT;
+
+		// Attempt to set own status flag back to PENDING to retry
+		if ( ! CAS( mine.clause_status, &cmp_status, PENDING ) )
+			return false; // If we fail then we lost so return false
+		
+		// Reset compare flag
+		cmp_status = UNSAT;
+	}
+	return true;
 }
 \end{cfa}
@@ -714,12 +722,12 @@
 // statement completion predicate
 bool check_completion( select_node * nodes ) {
-    return nodes[0].status && nodes[1].status || nodes[2].status;
+	return nodes[0].status && nodes[1].status || nodes[2].status;
 }
 if ( GA || GB || GC ) {				$\C{// skip statement if all guards false}$
-    select_node nodes[3];
-    nodes[0].status = ! GA && GB;	$\C{// A's status}$
-    nodes[1].status = ! GB && GA;	$\C{// B's status}$
-    nodes[2].status = ! GC;			$\C{// C's status}$
-    // ... rest of waituntil codegen ...
+	select_node nodes[3];
+	nodes[0].status = ! GA && GB;	$\C{// A's status}$
+	nodes[1].status = ! GB && GA;	$\C{// B's status}$
+	nodes[2].status = ! GC;			$\C{// C's status}$
+	// ... rest of waituntil codegen ...
 }
 \end{cfa}
@@ -772,30 +780,30 @@
 
 if ( any when_conditions[node] are true ) {
-    select_nodes nodes[N];									$\C{// declare N select nodes}$
-    try {
-        // ... set statuses for nodes with when_conditions[node] == false ...
-
-        for ( node in nodes )								$\C{// register nodes}$
-            if ( when_conditions[node] )
-                register_select( resource, node );
-
-        while ( !check_completion( nodes ) ) {	$\C{// check predicate}$
-            // block
-            for ( resource in waituntil statement ) {	$\C{// run true code blocks}$
-                if ( check_completion( nodes ) ) break;
-                if ( resource is avail )
-                    try {
-                        if( on_selected( resource ) )	$\C{// conditionally run block}$
-                            run code block
-                    } finally							$\C{// for exception safety}$
-                        unregister_select( resource, node ); $\C{// immediate unregister}$
-            }
-        }
-    } finally {											$\C{// for exception safety}$
-        for ( registered nodes in nodes )					$\C{// deregister nodes}$
-            if ( when_conditions[node] && unregister_select( resource, node )
-                    && on_selected( resource ) ) 
-                run code block							$\C{// run code block upon unregister}\CRT$
-    }
+	select_nodes nodes[N];									$\C{// declare N select nodes}$
+	try {
+		// ... set statuses for nodes with when_conditions[node] == false ...
+
+		for ( node in nodes )								$\C{// register nodes}$
+			if ( when_conditions[node] )
+				register_select( resource, node );
+
+		while ( !check_completion( nodes ) ) {	$\C{// check predicate}$
+			// block
+			for ( resource in waituntil statement ) {	$\C{// run true code blocks}$
+				if ( check_completion( nodes ) ) break;
+				if ( resource is avail )
+					try {
+						if( on_selected( resource ) )	$\C{// conditionally run block}$
+							run code block
+					} finally							$\C{// for exception safety}$
+						unregister_select( resource, node ); $\C{// immediate unregister}$
+			}
+		}
+	} finally {											$\C{// for exception safety}$
+		for ( registered nodes in nodes )					$\C{// deregister nodes}$
+			if ( when_conditions[node] && unregister_select( resource, node )
+					&& on_selected( resource ) ) 
+				run code block							$\C{// run code block upon unregister}\CRT$
+	}
 }
 \end{cfa}
