Index: generic/src/ddi/ddi.c
===================================================================
--- generic/src/ddi/ddi.c	(revision 2569ec90628757660b8e028954d0481dcbb2c3d7)
+++ generic/src/ddi/ddi.c	(revision b65caba198c5e73a38a403befaabc8928f0b3558)
@@ -76,5 +76,4 @@
 
 	ipl = interrupts_disable();
-	/* Lock the task and release the lock protecting tasks_btree. */
 	spinlock_lock(&TASK->lock);
 	
Index: generic/src/proc/task.c
===================================================================
--- generic/src/proc/task.c	(revision 2569ec90628757660b8e028954d0481dcbb2c3d7)
+++ generic/src/proc/task.c	(revision b65caba198c5e73a38a403befaabc8928f0b3558)
@@ -239,4 +239,9 @@
  * and interrupts must be disabled.
  *
+ * The task is guaranteed to exist after it was found in the tasks_btree as long as:
+ * @li the tasks_lock is held,
+ * @li the task's lock is held when task's lock is acquired before releasing tasks_lock or
+ * @li the task's refcount is grater than 0
+ *
  * @param id Task ID.
  *
Index: generic/src/proc/thread.c
===================================================================
--- generic/src/proc/thread.c	(revision 2569ec90628757660b8e028954d0481dcbb2c3d7)
+++ generic/src/proc/thread.c	(revision b65caba198c5e73a38a403befaabc8928f0b3558)
@@ -549,4 +549,7 @@
  * interrupts must be already disabled.
  *
+ * When a thread is found in threads_btree, it is guaranteed to exist as long
+ * as the threads_lock is held.
+ *
  * @param t Pointer to thread.
  *
