]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/wait.h
[PATCH] lockdep: annotate waitqueues
[linux-2.6-omap-h63xx.git] / include / linux / wait.h
index 544e855c7c02d9f6a10607a921d229e909a10efe..794be7af58aeff2191059ab350b1b258ea597a03 100644 (file)
@@ -68,7 +68,7 @@ struct task_struct;
        wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk)
 
 #define __WAIT_QUEUE_HEAD_INITIALIZER(name) {                          \
-       .lock           = SPIN_LOCK_UNLOCKED,                           \
+       .lock           = __SPIN_LOCK_UNLOCKED(name.lock),              \
        .task_list      = { &(name).task_list, &(name).task_list } }
 
 #define DECLARE_WAIT_QUEUE_HEAD(name) \
@@ -77,9 +77,15 @@ struct task_struct;
 #define __WAIT_BIT_KEY_INITIALIZER(word, bit)                          \
        { .flags = word, .bit_nr = bit, }
 
+/*
+ * lockdep: we want one lock-class for all waitqueue locks.
+ */
+extern struct lock_class_key waitqueue_lock_key;
+
 static inline void init_waitqueue_head(wait_queue_head_t *q)
 {
        spin_lock_init(&q->lock);
+       lockdep_set_class(&q->lock, &waitqueue_lock_key);
        INIT_LIST_HEAD(&q->task_list);
 }