Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2000 14:06:41 -0600
From:      Dan Nelson <dnelson@emsphone.com>
To:        Antoine Beaupre <beaupran@IRO.UMontreal.CA>
Cc:        Alfred Perlstein <bright@wintelcom.net>, Freebsd Questions Mailing list <freebsd-questions@FreeBSD.ORG>
Subject:   Re: PThreads
Message-ID:  <20000207140641.A84762@dan.emsphone.com>
In-Reply-To: <14495.7396.191900.130045@blc22.IRO.UMontreal.CA>; from "Antoine Beaupre" on Mon Feb  7 14:28:36 GMT 2000
References:  <14494.21789.847287.358066@anarcat.dyndns.org> <20000207101438.Y25520@fw.wintelcom.net> <20000207132244.A81581@dan.emsphone.com> <14495.7396.191900.130045@blc22.IRO.UMontreal.CA>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Feb 07), Antoine Beaupre said:
> Eh-eh... The program has to be linux-compatible and I don't think
> there's such a call in Linux (RH, at least) libs...
> 
> In fact, what I have done is that I simply pass the entry->d_name as
> an argument and then lock it with a mutex. Then I do a strdup, in the
> child thread.
> 
> Even if I strdup it, I end up with the same race problem on the new
> string instead of the 'd_name'... (no?)

Much easier to do the strdup in the parent thread, isn't it?  Then the
child can free it whenever it wants.

-- 
	Dan Nelson
	dnelson@emsphone.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000207140641.A84762>