Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 7b91c0e992ed493cc46d297ec3fe313c381a8dbc)
+++ libcfa/src/Makefile.am	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -76,4 +76,5 @@
 	stdlib.hfa \
 	time.hfa \
+	bits/weakso_locks.hfa \
 	containers/maybe.hfa \
 	containers/pair.hfa \
Index: libcfa/src/bits/collection.hfa
===================================================================
--- libcfa/src/bits/collection.hfa	(revision 7b91c0e992ed493cc46d297ec3fe313c381a8dbc)
+++ libcfa/src/bits/collection.hfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -1,9 +1,24 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// bits/collection.hfa -- PUBLIC
+// Intrusive singly-linked list
+//
+// Author           : Colby Alexander Parsons & Peter A. Buhr
+// Created On       : Thu Jan 21 19:46:50 2021
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
 #pragma once
-#include <stdio.h> // REMOVE THIS AFTER DEBUGGING
-
 
 struct Colable {
-	struct Colable * next;										// next node in the list
+	// next node in the list
 	// invariant: (next != 0) <=> listed()
+	struct Colable * next;
 };
 #ifdef __cforall
@@ -53,5 +68,5 @@
 	Collection & ?=?( const Collection & ) = void;		// no assignment
 
-	void ?{}( Collection & collection ) with( collection ) {	
+	void ?{}( Collection & collection ) with( collection ) {
 		root = 0p;
 	} // post: empty()
Index: libcfa/src/bits/sequence.hfa
===================================================================
--- libcfa/src/bits/sequence.hfa	(revision 7b91c0e992ed493cc46d297ec3fe313c381a8dbc)
+++ libcfa/src/bits/sequence.hfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -1,2 +1,18 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// bits/sequence.hfa -- PUBLIC
+// Intrusive doubly-linked list
+//
+// Author           : Colby Alexander Parsons & Peter A. Buhr
+// Created On       : Thu Jan 21 19:46:50 2021
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
 #pragma once
 
@@ -6,5 +22,6 @@
 struct Seqable {
 	__cfa_anonymous_object(Colable);
-	struct Seqable * back;										// pointer to previous node in the list
+	// pointer to previous node in the list
+	struct Seqable * back;
 };
 
@@ -27,11 +44,4 @@
 		return sq->back;
 	}
-
-	// // wrappers to make Collection have T
-	// forall( T & ) {
-	// 	T *& Back( T * n ) {
-	// 		return (T *)Back( (Seqable *)n );
-	// 	}
-	// } // distribution
 } // distribution
 
@@ -43,21 +53,24 @@
 // and the back field of the last node points at the first node (circular).
 
-forall( T & | { T *& Back ( T * ); T *& Next ( T * ); } ) {
+forall( T & ) {
 	struct Sequence {
-		inline Collection;								// Plan 9 inheritance
+		// Plan 9 inheritance
+		inline Collection;
 	};
 
 	static inline {
+		void ?{}( Sequence(T) &, const Sequence(T) & ) = void; // no copy
+		Sequence(T) & ?=?( const Sequence(T) & ) = void; // no assignment
+
+		void ?{}( Sequence(T) & s ) with( s ) {
+			((Collection &)s){};
+		}	// post: isEmpty()
+	}
+
+	static inline forall(| { T *& Back ( T * ); T *& Next ( T * ); }) {
 		// wrappers to make Collection have T
 		T & head( Sequence(T) & s ) with( s ) {
 			return *(T *)head( (Collection &)s );
 		} // post: empty() & head() == 0 | !empty() & head() in *s
-
-		void ?{}( Sequence(T) &, const Sequence(T) & ) = void; // no copy
-		Sequence(T) & ?=?( const Sequence(T) & ) = void; // no assignment
-
-		void ?{}( Sequence(T) & s ) with( s ) {	
-			((Collection &)s){};
-		}	// post: isEmpty()
 
 		// Return a pointer to the last sequence element, without removing it.
@@ -145,5 +158,5 @@
 			return n;
 		} // post: n->listed() & *n in *s & succ(n) == bef
-		
+
 		// pre: n->listed() & *n in *s
 		T & remove( Sequence(T) & s, T & n ) with( s ) { // O(1)
@@ -285,5 +298,5 @@
 
 	static inline {
-		void ?{}( SeqIterRev(T) & si ) with( si ) {	
+		void ?{}( SeqIterRev(T) & si ) with( si ) {
 			((ColIter &)si){};
 			seq = 0p;
@@ -291,5 +304,5 @@
 
 		// Create a iterator active in sequence s.
-		void ?{}( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {	
+		void ?{}( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {
 			((ColIter &)si){};
 			seq = &s;
@@ -297,5 +310,5 @@
 		} // post: elts = null
 
-		void ?{}( SeqIterRev(T) & si, Sequence(T) & s, T & start ) with( si ) {	
+		void ?{}( SeqIterRev(T) & si, Sequence(T) & s, T & start ) with( si ) {
 			((ColIter &)si){};
 			seq = &s;
Index: libcfa/src/bits/weakso_locks.cfa
===================================================================
--- libcfa/src/bits/weakso_locks.cfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
+++ libcfa/src/bits/weakso_locks.cfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -0,0 +1,30 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// bits/weakso_locks.hfa -- PUBLIC
+// Runtime locks that are compiled out when used without linking the runtime
+// thread system.
+//
+// Author           : Thierry Delisle
+// Created On       : Thu Jan 21 19:59:25 2021
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+#include "bits/weakso_locks.hfa"
+
+void  ?{}( blocking_lock & this, bool multi_acquisition, bool strict_owner ) {}
+void ^?{}( blocking_lock & this ) {}
+
+void lock( blocking_lock & this ) {}
+bool try_lock( blocking_lock & this ) { return false; }
+void unlock( blocking_lock & this ) {}
+void on_notify( blocking_lock & this, struct $thread * t ) {}
+void on_wait( blocking_lock & this ) {}
+size_t wait_count( blocking_lock & this ) { return 0; }
+void set_recursion_count( blocking_lock & this, size_t recursion ) {}
+size_t get_recursion_count( blocking_lock & this ) { return 0; }
Index: libcfa/src/bits/weakso_locks.hfa
===================================================================
--- libcfa/src/bits/weakso_locks.hfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
+++ libcfa/src/bits/weakso_locks.hfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -0,0 +1,74 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// bits/weakso_locks.hfa -- PUBLIC
+// Runtime locks that are compiled out when used without linking the runtime
+// thread system.
+//
+// Author           : Thierry Delisle
+// Created On       : Thu Jan 21 19:46:50 2021
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+#include "bits/locks.hfa"
+#include "bits/sequence.hfa"
+#include "bits/containers.hfa"
+
+struct $thread;
+
+//-----------------------------------------------------------------------------
+// Blocking Locks
+struct blocking_lock {
+	// Spin lock used for mutual exclusion
+	__spinlock_t lock;
+
+	// List of blocked threads
+	Sequence( $thread ) blocked_threads;
+
+	// Count of current blocked threads
+	size_t wait_count;
+
+	// Flag if the lock allows multiple acquisition
+	bool multi_acquisition;
+
+	// Flag if lock can be released by non owner
+	bool strict_owner;
+
+	// Current thread owning the lock
+	struct $thread * owner;
+
+	// Number of recursion level
+	size_t recursion_count;
+};
+
+void  ?{}( blocking_lock & this, bool multi_acquisition, bool strict_owner ) OPTIONAL_THREAD;
+void ^?{}( blocking_lock & this ) OPTIONAL_THREAD;
+
+void lock( blocking_lock & this ) OPTIONAL_THREAD;
+bool try_lock( blocking_lock & this ) OPTIONAL_THREAD;
+void unlock( blocking_lock & this ) OPTIONAL_THREAD;
+void on_notify( blocking_lock & this, struct $thread * t ) OPTIONAL_THREAD;
+void on_wait( blocking_lock & this ) OPTIONAL_THREAD;
+size_t wait_count( blocking_lock & this ) OPTIONAL_THREAD;
+void set_recursion_count( blocking_lock & this, size_t recursion ) OPTIONAL_THREAD;
+size_t get_recursion_count( blocking_lock & this ) OPTIONAL_THREAD;
+
+//----------
+struct multiple_acquisition_lock {
+	inline blocking_lock;
+};
+
+
+static inline void  ?{}( multiple_acquisition_lock & this ) {((blocking_lock &)this){ true, false };}
+static inline void ^?{}( multiple_acquisition_lock & this ) {}
+static inline void   lock     ( multiple_acquisition_lock & this ) { lock   ( (blocking_lock &)this ); }
+static inline void   unlock   ( multiple_acquisition_lock & this ) { unlock ( (blocking_lock &)this ); }
+static inline void   on_wait  ( multiple_acquisition_lock & this ) { on_wait( (blocking_lock &)this ); }
+static inline void   on_notify( multiple_acquisition_lock & this, struct $thread * t ){ on_notify( (blocking_lock &)this, t ); }
+static inline void   set_recursion_count( multiple_acquisition_lock & this, size_t recursion ){ set_recursion_count( (blocking_lock &)this, recursion ); }
+static inline size_t get_recursion_count( multiple_acquisition_lock & this ){ return get_recursion_count( (blocking_lock &)this ); }
Index: libcfa/src/concurrency/locks.cfa
===================================================================
--- libcfa/src/concurrency/locks.cfa	(revision 7b91c0e992ed493cc46d297ec3fe313c381a8dbc)
+++ libcfa/src/concurrency/locks.cfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -1,2 +1,20 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// locks.hfa -- LIBCFATHREAD
+// Runtime locks that used with the runtime thread system.
+//
+// Author           : Colby Alexander Parsons
+// Created On       : Thu Jan 21 19:46:50 2021
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+#define __cforall_thread__
+
 #include "locks.hfa"
 #include "kernel_private.hfa"
@@ -56,10 +74,5 @@
 
 void ^?{}( blocking_lock & this ) {}
-void  ?{}( single_acquisition_lock & this ) {((blocking_lock &)this){ false, false };}
-void ^?{}( single_acquisition_lock & this ) {}
-void  ?{}( owner_lock & this ) {((blocking_lock &)this){ true, true };}
-void ^?{}( owner_lock & this ) {}
-void  ?{}( multiple_acquisition_lock & this ) {((blocking_lock &)this){ true, false };}
-void ^?{}( multiple_acquisition_lock & this ) {}
+
 
 void lock( blocking_lock & this ) with( this ) {
@@ -168,28 +181,4 @@
 	unlock( lock );
 }
-
-//-----------------------------------------------------------------------------
-// Overloaded routines for traits
-// These routines are temporary until an inheritance bug is fixed
-void   lock      ( single_acquisition_lock & this ) { lock   ( (blocking_lock &)this ); }
-void   unlock    ( single_acquisition_lock & this ) { unlock ( (blocking_lock &)this ); }
-void   on_wait   ( single_acquisition_lock & this ) { on_wait( (blocking_lock &)this ); }
-void   on_notify ( single_acquisition_lock & this, struct $thread * t ) { on_notify( (blocking_lock &)this, t ); }
-void   set_recursion_count( single_acquisition_lock & this, size_t recursion ) { set_recursion_count( (blocking_lock &)this, recursion ); }
-size_t get_recursion_count( single_acquisition_lock & this ) { return get_recursion_count( (blocking_lock &)this ); }
-
-void   lock     ( owner_lock & this ) { lock   ( (blocking_lock &)this ); }
-void   unlock   ( owner_lock & this ) { unlock ( (blocking_lock &)this ); }
-void   on_wait  ( owner_lock & this ) { on_wait( (blocking_lock &)this ); }
-void   on_notify( owner_lock & this, struct $thread * t ) { on_notify( (blocking_lock &)this, t ); }
-void   set_recursion_count( owner_lock & this, size_t recursion ) { set_recursion_count( (blocking_lock &)this, recursion ); }
-size_t get_recursion_count( owner_lock & this ) { return get_recursion_count( (blocking_lock &)this ); }
-
-void   lock     ( multiple_acquisition_lock & this ) { lock   ( (blocking_lock &)this ); }
-void   unlock   ( multiple_acquisition_lock & this ) { unlock ( (blocking_lock &)this ); }
-void   on_wait  ( multiple_acquisition_lock & this ) { on_wait( (blocking_lock &)this ); }
-void   on_notify( multiple_acquisition_lock & this, struct $thread * t ){ on_notify( (blocking_lock &)this, t ); }
-void   set_recursion_count( multiple_acquisition_lock & this, size_t recursion ){ set_recursion_count( (blocking_lock &)this, recursion ); }
-size_t get_recursion_count( multiple_acquisition_lock & this ){ return get_recursion_count( (blocking_lock &)this ); }
 
 //-----------------------------------------------------------------------------
Index: libcfa/src/concurrency/locks.hfa
===================================================================
--- libcfa/src/concurrency/locks.hfa	(revision 7b91c0e992ed493cc46d297ec3fe313c381a8dbc)
+++ libcfa/src/concurrency/locks.hfa	(revision ab1b971e619522ae51be851c9a3fbf478c0d978a)
@@ -1,13 +1,54 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// locks.hfa -- PUBLIC
+// Runtime locks that used with the runtime thread system.
+//
+// Author           : Colby Alexander Parsons
+// Created On       : Thu Jan 21 19:46:50 2021
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
 #pragma once
 
 #include <stdbool.h>
 
-#include "bits/locks.hfa"
-#include "bits/sequence.hfa"
-
-#include "invoke.h"
+#include "bits/weakso_locks.hfa"
 
 #include "time_t.hfa"
 #include "time.hfa"
+
+//----------
+struct single_acquisition_lock {
+	inline blocking_lock;
+};
+
+static inline void  ?{}( single_acquisition_lock & this ) {((blocking_lock &)this){ false, false };}
+static inline void ^?{}( single_acquisition_lock & this ) {}
+static inline void   lock      ( single_acquisition_lock & this ) { lock   ( (blocking_lock &)this ); }
+static inline void   unlock    ( single_acquisition_lock & this ) { unlock ( (blocking_lock &)this ); }
+static inline void   on_wait   ( single_acquisition_lock & this ) { on_wait( (blocking_lock &)this ); }
+static inline void   on_notify ( single_acquisition_lock & this, struct $thread * t ) { on_notify( (blocking_lock &)this, t ); }
+static inline void   set_recursion_count( single_acquisition_lock & this, size_t recursion ) { set_recursion_count( (blocking_lock &)this, recursion ); }
+static inline size_t get_recursion_count( single_acquisition_lock & this ) { return get_recursion_count( (blocking_lock &)this ); }
+
+//----------
+struct owner_lock {
+	inline blocking_lock;
+};
+
+static inline void  ?{}( owner_lock & this ) {((blocking_lock &)this){ true, true };}
+static inline void ^?{}( owner_lock & this ) {}
+static inline void   lock     ( owner_lock & this ) { lock   ( (blocking_lock &)this ); }
+static inline void   unlock   ( owner_lock & this ) { unlock ( (blocking_lock &)this ); }
+static inline void   on_wait  ( owner_lock & this ) { on_wait( (blocking_lock &)this ); }
+static inline void   on_notify( owner_lock & this, struct $thread * t ) { on_notify( (blocking_lock &)this, t ); }
+static inline void   set_recursion_count( owner_lock & this, size_t recursion ) { set_recursion_count( (blocking_lock &)this, recursion ); }
+static inline size_t get_recursion_count( owner_lock & this ) { return get_recursion_count( (blocking_lock &)this ); }
 
 //-----------------------------------------------------------------------------
@@ -38,83 +79,4 @@
 	info_thread(L) *& Next( info_thread(L) * this );
 }
-
-//-----------------------------------------------------------------------------
-// Blocking Locks
-struct blocking_lock {
-	// Spin lock used for mutual exclusion
-	__spinlock_t lock;
-
-	// List of blocked threads
-	Sequence( $thread ) blocked_threads;
-
-	// Count of current blocked threads
-	size_t wait_count;
-
-	// Flag if the lock allows multiple acquisition
-	bool multi_acquisition;
-
-	// Flag if lock can be released by non owner
-	bool strict_owner;
-
-	// Current thread owning the lock
-	struct $thread * owner;
-
-	// Number of recursion level
-	size_t recursion_count;
-};
-
-struct single_acquisition_lock {
-	inline blocking_lock;
-};
-
-struct owner_lock {
-	inline blocking_lock;
-};
-
-struct multiple_acquisition_lock {
-	inline blocking_lock;
-};
-
-void  ?{}( blocking_lock & this, bool multi_acquisition, bool strict_owner );
-void ^?{}( blocking_lock & this );
-
-void  ?{}( single_acquisition_lock & this );
-void ^?{}( single_acquisition_lock & this );
-
-void  ?{}( owner_lock & this );
-void ^?{}( owner_lock & this );
-
-void  ?{}( multiple_acquisition_lock & this );
-void ^?{}( multiple_acquisition_lock & this );
-
-void lock( blocking_lock & this );
-bool try_lock( blocking_lock & this );
-void unlock( blocking_lock & this );
-void on_notify( blocking_lock & this, struct $thread * t );
-void on_wait( blocking_lock & this );
-size_t wait_count( blocking_lock & this );
-void set_recursion_count( blocking_lock & this, size_t recursion );
-size_t get_recursion_count( blocking_lock & this );
-
-void lock( single_acquisition_lock & this );
-void unlock( single_acquisition_lock & this );
-void on_notify( single_acquisition_lock & this, struct $thread * t );
-void on_wait( single_acquisition_lock & this );
-void set_recursion_count( single_acquisition_lock & this, size_t recursion );
-size_t get_recursion_count( single_acquisition_lock & this );
-
-void lock( owner_lock & this );
-void unlock( owner_lock & this );
-void on_notify( owner_lock & this, struct $thread * t );
-void on_wait( owner_lock & this );
-void set_recursion_count( owner_lock & this, size_t recursion );
-size_t get_recursion_count( owner_lock & this );
-
-void lock( multiple_acquisition_lock & this );
-void unlock( multiple_acquisition_lock & this );
-void on_notify( multiple_acquisition_lock & this, struct $thread * t );
-void on_wait( multiple_acquisition_lock & this );
-void set_recursion_count( multiple_acquisition_lock & this, size_t recursion );
-size_t get_recursion_count( multiple_acquisition_lock & this );
 
 //-----------------------------------------------------------------------------
