diff options
-rw-r--r-- | include/linux/sched.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 38c8654aaa96..49e617fa0f66 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -121,6 +121,17 @@ extern unsigned long nr_iowait(void); | |||
121 | #define set_task_state(tsk, state_value) \ | 121 | #define set_task_state(tsk, state_value) \ |
122 | set_mb((tsk)->state, (state_value)) | 122 | set_mb((tsk)->state, (state_value)) |
123 | 123 | ||
124 | /* | ||
125 | * set_current_state() includes a barrier so that the write of current->state | ||
126 | * is correctly serialised wrt the caller's subsequent test of whether to | ||
127 | * actually sleep: | ||
128 | * | ||
129 | * set_current_state(TASK_UNINTERRUPTIBLE); | ||
130 | * if (do_i_need_to_sleep()) | ||
131 | * schedule(); | ||
132 | * | ||
133 | * If the caller does not need such serialisation then use __set_current_state() | ||
134 | */ | ||
124 | #define __set_current_state(state_value) \ | 135 | #define __set_current_state(state_value) \ |
125 | do { current->state = (state_value); } while (0) | 136 | do { current->state = (state_value); } while (0) |
126 | #define set_current_state(state_value) \ | 137 | #define set_current_state(state_value) \ |