[PATCH 2/2] remove tcp->parent and TCB_CLONE_THREAD

Dmitry V. Levin ldv at altlinux.org
Mon Aug 1 21:55:30 UTC 2011


On Sat, Jun 25, 2011 at 11:34:41AM +0200, Denys Vlasenko wrote:
> +#ifdef LINUX
> +/* Temporarily hijack this bit to mark tcb's we already attached */
> +# define TCB_ATTACH_DONE TCB_INSYSCALL

We are not short of unused flags yet to apply such tricks, and your patch
series makes even more room for future flags allocation.

> +#else
> +# define TCB_ATTACH_DONE 0

And this is not needed anyway, see below.

> @@ -537,6 +540,15 @@ startup_attach(void)
>  				tcp->pid);
>  	} /* for each tcbtab[] */
>  
> + ret:
> +	if (TCB_ATTACH_DONE) {
> +		for (tcbi = 0; tcbi < tcbtabsize; tcbi++) {
> +			tcp = tcbtab[tcbi];
> +			tcp->flags &= ~TCB_ATTACH_DONE;
> +		}
> +	}
> +#undef TCB_ATTACH_DONE
> +

This new hunk should be wrapped with #ifdef LINUX, and the check for
TCB_ATTACH_DONE != 0 could be safely omitted.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110802/e9451559/attachment.bin>


More information about the Strace-devel mailing list