[CRIU] [PATCH 1/2] pstree: Introduce task_alive() helper

Cyrill Gorcunov gorcunov at gmail.com
Fri Aug 8 04:07:40 PDT 2014


On Fri, Aug 08, 2014 at 03:05:02PM +0400, Pavel Emelyanov wrote:
> > 
> > I would rather do
> > 
> > static inline bool task_is(struct pstree_item *i, int state)
> > {
> > 	return i->state == state;
> > }
> > 
> > #define task_is_alive(i) 	(task_is(i, TASK_ALIVE) || task_is(i, TASK_STOPPED))
> > #define task_is_dead(i) 	(task_is(i, TASK_DEAD))
> > #define task_is_helper(i) 	(task_is(i, TASK_HELPER))
> > 
> > ?
> 
> Just more code from my POV. What I would do it turn state from number into bits
> so that task_alive() becomes i->state & (TASK_ALIVE | TASK_STOPPED)

I see. Leave it as is then.


More information about the CRIU mailing list