Perhaps we can add "atomic_t xxx" to task_struct.
int freezing(struct task_struct *p)
{
return test_tsk_thread_flag(p, TIF_FREEZE)
&& atomic_read(&p->xxx) == 0;
}
void xxx_start(struct task_struct *p)
{
atomic_inc(p->xxx);
thaw_process(p);
}
xxx_end(struct task_struct *p)
{
atomic_dec(p->xxx);
}
Now,
xxx_start(p);
... wait for something which depends on p...
xxx_end(p);
Of course we need other changes, freeze_process() should check ->xxx, etc.
I am not sure this makes sense.
Oleg.
-