diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-11-03 09:49:01 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-11-03 09:49:01 -0500 |
commit | e856359685143a2f65876e7db4e4aa0ef5dce7f0 (patch) | |
tree | bbcafe7f23975979f7a2bc6fd1404908d5fd7bd1 /kernel/freezer.c | |
parent | e3bd9ec5d8bfc90f9e1bd995677829e57a404061 (diff) | |
parent | 45beca08dd8b6d6a65c5ffd730af2eac7a2c7a03 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into s3c-moves2
Diffstat (limited to 'kernel/freezer.c')
-rw-r--r-- | kernel/freezer.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/freezer.c b/kernel/freezer.c index ba6248b323ef..2f4936cf7083 100644 --- a/kernel/freezer.c +++ b/kernel/freezer.c | |||
@@ -121,16 +121,7 @@ void cancel_freezing(struct task_struct *p) | |||
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | /* | 124 | static int __thaw_process(struct task_struct *p) |
125 | * Wake up a frozen process | ||
126 | * | ||
127 | * task_lock() is needed to prevent the race with refrigerator() which may | ||
128 | * occur if the freezing of tasks fails. Namely, without the lock, if the | ||
129 | * freezing of tasks failed, thaw_tasks() might have run before a task in | ||
130 | * refrigerator() could call frozen_process(), in which case the task would be | ||
131 | * frozen and no one would thaw it. | ||
132 | */ | ||
133 | int __thaw_process(struct task_struct *p) | ||
134 | { | 125 | { |
135 | if (frozen(p)) { | 126 | if (frozen(p)) { |
136 | p->flags &= ~PF_FROZEN; | 127 | p->flags &= ~PF_FROZEN; |
@@ -140,6 +131,15 @@ int __thaw_process(struct task_struct *p) | |||
140 | return 0; | 131 | return 0; |
141 | } | 132 | } |
142 | 133 | ||
134 | /* | ||
135 | * Wake up a frozen process | ||
136 | * | ||
137 | * task_lock() is needed to prevent the race with refrigerator() which may | ||
138 | * occur if the freezing of tasks fails. Namely, without the lock, if the | ||
139 | * freezing of tasks failed, thaw_tasks() might have run before a task in | ||
140 | * refrigerator() could call frozen_process(), in which case the task would be | ||
141 | * frozen and no one would thaw it. | ||
142 | */ | ||
143 | int thaw_process(struct task_struct *p) | 143 | int thaw_process(struct task_struct *p) |
144 | { | 144 | { |
145 | task_lock(p); | 145 | task_lock(p); |