From owner-freebsd-questions Mon Feb 7 12: 6:13 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by builder.freebsd.org (Postfix) with ESMTP id 80AD74019 for ; Mon, 7 Feb 2000 12:06:07 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id OAA85285; Mon, 7 Feb 2000 14:06:41 -0600 (CST) (envelope-from dan) Date: Mon, 7 Feb 2000 14:06:41 -0600 From: Dan Nelson To: Antoine Beaupre Cc: Alfred Perlstein , Freebsd Questions Mailing list Subject: Re: PThreads Message-ID: <20000207140641.A84762@dan.emsphone.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <14495.7396.191900.130045@blc22.IRO.UMontreal.CA>; from "Antoine Beaupre" on Mon Feb 7 14:28:36 GMT 2000 X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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