Index: libcfa/src/bits/locks.hfa
===================================================================
--- libcfa/src/bits/locks.hfa	(revision 95789be69da1e578ec7ea697904a12ffc63b0263)
+++ libcfa/src/bits/locks.hfa	(revision 93526eff6dca205bb603822b700f1da46072949a)
@@ -219,3 +219,37 @@
 		}
 	}
+
+	// Semaphore which only supports a single thread and one post
+	// Semaphore which only supports a single thread
+	struct oneshot {
+		struct $thread * volatile ptr;
+	};
+
+	static inline {
+		void  ?{}(oneshot & this) {
+			this.ptr = 0p;
+		}
+
+		void ^?{}(oneshot & this) {}
+
+		bool wait(oneshot & this) {
+			for() {
+				struct $thread * expected = this.ptr;
+				if(expected == 1p) return false;
+				/* paranoid */ verify( expected == 0p );
+				if(__atomic_compare_exchange_n(&this.ptr, &expected, active_thread(), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) {
+					park( __cfaabi_dbg_ctx );
+					/* paranoid */ verify( this.ptr == 1p );
+					return true;
+				}
+			}
+		}
+
+		bool post(oneshot & this) {
+			struct $thread * got = __atomic_exchange_n( &this.ptr, 1p, __ATOMIC_SEQ_CST);
+			if( got == 0p ) return false;
+			unpark( got __cfaabi_dbg_ctx2 );
+			return true;
+		}
+	}
 #endif
