Index: generic/include/proc/task.h
===================================================================
--- generic/include/proc/task.h	(revision a4490654f8f7fc616b908314bd550413e0c322d8)
+++ generic/include/proc/task.h	(revision 4fded58aa3e9d077e85ec03f4c86b755c84c174a)
@@ -32,4 +32,5 @@
 #include <typedefs.h>
 #include <synch/spinlock.h>
+#include <synch/mutex.h>
 #include <adt/btree.h>
 #include <adt/list.h>
@@ -54,4 +55,11 @@
 	
 	task_arch_t arch;	/**< Architecture specific task data. */
+	
+	/**
+	  * Serializes access to the B+tree of task's futexes. This mutex is
+	  * independent on the task spinlock.
+	  */
+	mutex_t futexes_lock;
+	btree_t futexes;	/**< B+tree of futexes referenced by this task. */
 };
 
Index: generic/include/synch/futex.h
===================================================================
--- generic/include/synch/futex.h	(revision a4490654f8f7fc616b908314bd550413e0c322d8)
+++ generic/include/synch/futex.h	(revision 4fded58aa3e9d077e85ec03f4c86b755c84c174a)
@@ -41,4 +41,5 @@
 	waitq_t wq;		/**< Wait queue for threads waiting for futex availability. */
 	link_t ht_link;		/**< Futex hash table link. */
+	count_t refcount;	/**< Number of tasks that reference this futex. */
 };
 
