]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/sched.h
signals: annotate lock_task_sighand()
[net-next-2.6.git] / include / linux / sched.h
index 393ce94e54b77155227f5df48cf7e81e6b9ec09f..3ff5c8519abdeeb601d2376d784273e546e05eb3 100644 (file)
@@ -2236,9 +2236,16 @@ static inline void task_unlock(struct task_struct *p)
        spin_unlock(&p->alloc_lock);
 }
 
-extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
+extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
                                                        unsigned long *flags);
 
+#define lock_task_sighand(tsk, flags)                                  \
+({     struct sighand_struct *__ss;                                    \
+       __cond_lock(&(tsk)->sighand->siglock,                           \
+                   (__ss = __lock_task_sighand(tsk, flags)));          \
+       __ss;                                                           \
+})                                                                     \
+
 static inline void unlock_task_sighand(struct task_struct *tsk,
                                                unsigned long *flags)
 {