aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/process.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 2cea2658e98..d31d638ab4c 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -31,6 +31,18 @@ static inline int freezeable(struct task_struct * p)
return 1;
}
+/*
+ * freezing is complete, mark current process as frozen
+ */
+static inline void frozen_process(void)
+{
+ if (!unlikely(current->flags & PF_NOFREEZE)) {
+ current->flags |= PF_FROZEN;
+ wmb();
+ }
+ clear_tsk_thread_flag(current, TIF_FREEZE);
+}
+
/* Refrigerator is place where frozen processes are stored :-). */
void refrigerator(void)
{
@@ -40,7 +52,7 @@ void refrigerator(void)
task_lock(current);
if (freezing(current)) {
- frozen_process(current);
+ frozen_process();
task_unlock(current);
} else {
task_unlock(current);