/* task_lock() is needed to prevent the race with refrigerator() which may occur if the freezing of tasks fails. Namely, without the lock, if the freezing of tasks failed, thaw_tasks() might have run before a task in refrigerator() could call frozen_process(), in which case the task would be frozen and no one would thaw it.  */
int thaw_process(struct task_struct *p)
/* task_lock() is needed to prevent the race with refrigerator() which may occur if the freezing of tasks fails. Namely, without the lock, if the freezing of tasks failed, thaw_tasks() might have run before a task in refrigerator() could call frozen_process(), in which case the task would be frozen and no one would thaw it.  */
int thaw_process(struct task_struct *p)
{
	task_lock(p);
	if (__thaw_process(p) == 1) {
		task_unlock(p);
		wake_up_process(p);
		return 1;
	}
	task_unlock(p);
	return 0;
}