[CRIU] [PATCH 1/6] dump: don't restore a state of threads

Andrew Vagin avagin at parallels.com
Thu Dec 19 05:10:20 PST 2013


On Thu, Dec 19, 2013 at 05:03:17PM +0400, Cyrill Gorcunov wrote:
> On Thu, Dec 19, 2013 at 04:59:41PM +0400, Andrey Vagin wrote:
> > @@ -785,8 +785,10 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st)
> >  {
> >  	int i;
> >  
> > -	for (i = 0; i < item->nr_threads; i++)
> > -		unseize_task(item->threads[i].real, st); /* item->pid will be here */
> > +	unseize_task(item->pid.real, st); /* item->pid will be here */

unseize thread leader

> > +
> > +	for (i = 1; i < item->nr_threads; i++)
> > +		ptrace(PTRACE_DETACH, item->threads[i].real, NULL, NULL);
> >  }
> 
> So it walks over the threads only (i = 1), is it intentional?

The 0 index is used for thread leader


More information about the CRIU mailing list