Index: src/libcfa/concurrency/monitor
===================================================================
--- src/libcfa/concurrency/monitor	(revision 690f13c38d3a5ec73971561f04e500f6ceba7c9c)
+++ src/libcfa/concurrency/monitor	(revision 5ea06d660ab6356382606a997c07e3b85c308c4d)
@@ -30,11 +30,9 @@
 }
 
-//Array entering routine
-void enter(monitor_desc **, int count);
-void leave(monitor_desc **, int count);
-
 struct monitor_guard_t {
 	monitor_desc ** m;
 	int count;
+      monitor_desc ** prev_mntrs;
+      unsigned short  prev_count;
 };
 
@@ -43,15 +41,21 @@
 }
 
-static inline void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) {
-	this->m = m;
-	this->count = count;
-	qsort(this->m, count);
-	enter( this->m, this->count );
+void ?{}( monitor_guard_t * this, monitor_desc ** m, int count );
+void ^?{}( monitor_guard_t * this );
+
+//-----------------------------------------------------------------------------
+// Internal scheduling
+struct condition {
+	__thread_queue_t blocked;
+	monitor_desc ** monitors;
+	unsigned short monitor_count;
+};
+
+static inline void ?{}( condition * this ) {
+	this->monitors = NULL;
+	this->monitor_count = 0;
 }
 
-static inline void ^?{}( monitor_guard_t * this ) {
-	leave( this->m, this->count );
-}
-
-
+void wait( condition * this );
+void signal( condition * this );
 #endif //MONITOR_H
