Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8755
b: refs/heads/master
c: 498d0c5
h: refs/heads/master
i:
  8753: aab3f5d
  8751: 8f70608
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Sep 13, 2005
1 parent a70c45f commit ca45170
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 921717a2a1cde78c9b2aa971c16510d63efe7320
refs/heads/master: 498d0c5711094b0e1fd93f5355d270ccebdec706
11 changes: 11 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ extern unsigned long nr_iowait(void);
#define set_task_state(tsk, state_value) \
set_mb((tsk)->state, (state_value))

/*
* set_current_state() includes a barrier so that the write of current->state
* is correctly serialised wrt the caller's subsequent test of whether to
* actually sleep:
*
* set_current_state(TASK_UNINTERRUPTIBLE);
* if (do_i_need_to_sleep())
* schedule();
*
* If the caller does not need such serialisation then use __set_current_state()
*/
#define __set_current_state(state_value) \
do { current->state = (state_value); } while (0)
#define set_current_state(state_value) \
Expand Down

0 comments on commit ca45170

Please sign in to comment.