aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/freezer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/freezer.h')
-rw-r--r--include/linux/freezer.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 393063096134..5e75e26d4787 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -16,16 +16,15 @@ static inline int frozen(struct task_struct *p)
16 */ 16 */
17static inline int freezing(struct task_struct *p) 17static inline int freezing(struct task_struct *p)
18{ 18{
19 return p->flags & PF_FREEZE; 19 return test_tsk_thread_flag(p, TIF_FREEZE);
20} 20}
21 21
22/* 22/*
23 * Request that a process be frozen 23 * Request that a process be frozen
24 * FIXME: SMP problem. We may not modify other process' flags!
25 */ 24 */
26static inline void freeze(struct task_struct *p) 25static inline void freeze(struct task_struct *p)
27{ 26{
28 p->flags |= PF_FREEZE; 27 set_tsk_thread_flag(p, TIF_FREEZE);
29} 28}
30 29
31/* 30/*
@@ -33,7 +32,7 @@ static inline void freeze(struct task_struct *p)
33 */ 32 */
34static inline void do_not_freeze(struct task_struct *p) 33static inline void do_not_freeze(struct task_struct *p)
35{ 34{
36 p->flags &= ~PF_FREEZE; 35 clear_tsk_thread_flag(p, TIF_FREEZE);
37} 36}
38 37
39/* 38/*
@@ -54,7 +53,9 @@ static inline int thaw_process(struct task_struct *p)
54 */ 53 */
55static inline void frozen_process(struct task_struct *p) 54static inline void frozen_process(struct task_struct *p)
56{ 55{
57 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN; 56 p->flags |= PF_FROZEN;
57 wmb();
58 clear_tsk_thread_flag(p, TIF_FREEZE);
58} 59}
59 60
60extern void refrigerator(void); 61extern void refrigerator(void);