[CRIU] [PATCH 3/7] parasite: Add init_thread() helper

Cyrill Gorcunov gorcunov at openvz.org
Tue Nov 6 04:10:21 EST 2012


On Tue, Nov 06, 2012 at 01:07:28PM +0400, Pavel Emelyanov wrote:
> > @@ -27,10 +27,13 @@ static struct tid_state_s {
> >  } *tid_state;
> >  
> >  static unsigned int nr_tid_state;
> > +static unsigned int next_tid_state;
> > +
> >  #define TID_STATE_SIZE(n)	\
> >  	(ALIGN(sizeof(struct tid_state_s) * n, PAGE_SIZE))
> >  
> >  #define thread_leader	(&tid_state[0])
> > +#define thread_next	(&tid_state[next_tid_state])
> 
> These are obfuscating names. Don't do that.

Well, I tend to agree that thread_next might be a bit unclear but
as to thread_leader -- no, it's not obfuscating, it represents
exactly what we have, tid_state[0] is _always_ a thread leader
and instead of keeping that implied better to explress with
representative name.


More information about the CRIU mailing list