process.c (d2137d5af4259f50c19addb8246a186c9ffac325) | process.c (58a69cb47ec6991bf006a3e5d202e8571b0327a4) |
---|---|
1/* 2 * drivers/power/process.c - Functions for starting/stopping processes on 3 * suspend transitions. 4 * 5 * Originally from swsusp. 6 */ 7 8 --- 8 unchanged lines hidden (view full) --- 17#include <linux/delay.h> 18#include <linux/workqueue.h> 19 20/* 21 * Timeout for stopping processes 22 */ 23#define TIMEOUT (20 * HZ) 24 | 1/* 2 * drivers/power/process.c - Functions for starting/stopping processes on 3 * suspend transitions. 4 * 5 * Originally from swsusp. 6 */ 7 8 --- 8 unchanged lines hidden (view full) --- 17#include <linux/delay.h> 18#include <linux/workqueue.h> 19 20/* 21 * Timeout for stopping processes 22 */ 23#define TIMEOUT (20 * HZ) 24 |
25static inline int freezeable(struct task_struct * p) | 25static inline int freezable(struct task_struct * p) |
26{ 27 if ((p == current) || 28 (p->flags & PF_NOFREEZE) || 29 (p->exit_state != 0)) 30 return 0; 31 return 1; 32} 33 --- 14 unchanged lines hidden (view full) --- 48 49 if (!sig_only) 50 freeze_workqueues_begin(); 51 52 while (true) { 53 todo = 0; 54 read_lock(&tasklist_lock); 55 do_each_thread(g, p) { | 26{ 27 if ((p == current) || 28 (p->flags & PF_NOFREEZE) || 29 (p->exit_state != 0)) 30 return 0; 31 return 1; 32} 33 --- 14 unchanged lines hidden (view full) --- 48 49 if (!sig_only) 50 freeze_workqueues_begin(); 51 52 while (true) { 53 todo = 0; 54 read_lock(&tasklist_lock); 55 do_each_thread(g, p) { |
56 if (frozen(p) || !freezeable(p)) | 56 if (frozen(p) || !freezable(p)) |
57 continue; 58 59 if (!freeze_task(p, sig_only)) 60 continue; 61 62 /* 63 * Now that we've done set_freeze_flag, don't 64 * perturb a task in TASK_STOPPED or TASK_TRACED. --- 97 unchanged lines hidden (view full) --- 162} 163 164static void thaw_tasks(bool nosig_only) 165{ 166 struct task_struct *g, *p; 167 168 read_lock(&tasklist_lock); 169 do_each_thread(g, p) { | 57 continue; 58 59 if (!freeze_task(p, sig_only)) 60 continue; 61 62 /* 63 * Now that we've done set_freeze_flag, don't 64 * perturb a task in TASK_STOPPED or TASK_TRACED. --- 97 unchanged lines hidden (view full) --- 162} 163 164static void thaw_tasks(bool nosig_only) 165{ 166 struct task_struct *g, *p; 167 168 read_lock(&tasklist_lock); 169 do_each_thread(g, p) { |
170 if (!freezeable(p)) | 170 if (!freezable(p)) |
171 continue; 172 173 if (nosig_only && should_send_signal(p)) 174 continue; 175 176 if (cgroup_freezing_or_frozen(p)) 177 continue; 178 --- 17 unchanged lines hidden --- | 171 continue; 172 173 if (nosig_only && should_send_signal(p)) 174 continue; 175 176 if (cgroup_freezing_or_frozen(p)) 177 continue; 178 --- 17 unchanged lines hidden --- |