Index: src/libcfa/concurrency/threads
===================================================================
--- src/libcfa/concurrency/threads	(revision 6a3d2e7f051b0a830ce5f421976d81987675c0fa)
+++ src/libcfa/concurrency/threads	(revision 81183038f1b7ed7a5af6658486d3db52f5d836e7)
@@ -18,5 +18,49 @@
 #define THREADS_H
 
+#include "assert"
+#include "invoke.h"
 
+#include "coroutines"
+
+//-----------------------------------------------------------------------------
+// Coroutine trait
+// Anything that implements this trait can be resumed.
+// Anything that is resumed is a coroutine.
+trait is_thread(dtype T /*| sized(T)*/) {
+      void co_main(T* this);
+      thread_h* get_thread(T* this);
+	/*void ?{}(T*);
+	void ^?{}(T*);*/
+};
+
+forall(otype T | is_thread(T) )
+static inline coroutine* get_coroutine(T* this) {
+	return &get_thread(this)->c;
+}
+
+//-----------------------------------------------------------------------------
+// Ctors and dtors
+void ?{}(thread_h* this);
+void ^?{}(thread_h* this);
+
+//-----------------------------------------------------------------------------
+// thread runner
+// Structure that actually start and stop threads
+forall(otype T | is_thread(T) )
+struct thread {
+	T handle;
+};
+
+forall(otype T | is_thread(T) )
+void ?{}( thread(T)* this );
+
+forall(otype T, ttype P | is_thread(T) | { void ?{}(T*, P); } )
+void ?{}( thread(T)* this, P params );
+
+forall(otype T | is_thread(T) )
+void ^?{}( thread(T)* this );
+
+//-----------------------------------------------------------------------------
+// PRIVATE exposed because of inline
 
 #endif //THREADS_H
