Index: generic/include/proc/thread.h
===================================================================
--- generic/include/proc/thread.h	(revision a80d406916e5a73d25c5e97341203bb477734ef7)
+++ generic/include/proc/thread.h	(revision 839470fe57530d3817745bc3323d249dae216918)
@@ -65,5 +65,10 @@
 	link_t threads_link;			/**< Link to the list of all threads. */
 	
-	/* items below are protected by lock */
+	/** Lock protecting thread structure.
+	 *
+	 * Protects the whole thread structure except list links above.
+	 * Must be acquired before T.lock for each T of type task_t.
+	 * 
+	 */
 	spinlock_t lock;
 
@@ -110,5 +115,12 @@
 };
 
-extern spinlock_t threads_lock;			/**< Lock protecting threads_head list. */
+/** Thread list lock.
+ *
+ * This lock protects all link_t structures chained in threads_head.
+ * Must be acquired before T.lock for each T of type thread_t.
+ *
+ */
+extern spinlock_t threads_lock;
+
 extern link_t threads_head;			/**< List of all threads in the system. */
 
Index: generic/include/synch/waitq.h
===================================================================
--- generic/include/synch/waitq.h	(revision a80d406916e5a73d25c5e97341203bb477734ef7)
+++ generic/include/synch/waitq.h	(revision 839470fe57530d3817745bc3323d249dae216918)
@@ -39,6 +39,13 @@
 #define WAKEUP_ALL	1
 
+/** Wait queue structure. */
 struct waitq {
+
+	/** Lock protecting wait queue structure.
+	 *
+	 * Must be acquired before T.lock for each T of type thread_t.
+	 */
 	spinlock_t lock;
+
 	int missed_wakeups;	/**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */
 	link_t head;		/**< List of sleeping threads for wich there was no missed_wakeup. */
@@ -52,6 +59,6 @@
 extern void waitq_initialize(waitq_t *wq);
 extern int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking);
-extern void waitq_wakeup(waitq_t *wq, int all);
-extern void _waitq_wakeup_unsafe(waitq_t *wq, int all);
+extern void waitq_wakeup(waitq_t *wq, bool all);
+extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all);
 
 #endif
