On Thu, Jan 21, 1999 at 12:38:14PM -0600, Richard Seaman, Jr. wrote: > On Thu, Jan 21, 1999 at 06:12:29PM +0200, Jeremy Lea wrote: > > > On Tue, Jan 19, 1999 at 09:11:51AM -0600, Richard Seaman, Jr. wrote: > > > Actually, the new version, in FreeBSD "ports" form, doesn't require > > > -DLINUXTHREADS anymore, but it does require -I/usr/local/include to > > > pick up the right header, since it installs a pthread.h into > > > /usr/local/include. This conflicts with the pthread.h in /usr/include. > > > > This is nagging at me. Having two headers of the same name, but importantly > > different content is asking for touble. There needs to be a way to ensure > > that only one or the other is picked up. The best way I can think of is to > > only include the contents of the user thread pthread.h if _THREAD_SAFE is > > defined (to force people to use the right defines...) and the contents of > > kernel thread pthread.h if _REENTRANT (and not _THREAD_SAFE) is defined. > > This has the added bonus of meaning that most linux apps wont have to be > > patched.
> Now, on the topic of conflicting pthread.h files, I agree this is a > problem. One choice, which I originally implemented, is to fix > pthread.h so it pulls in the right data based on a swtich (eg. > if LINUXTHREADS is defined, pull in LT headers, else pull in > user threads headers). I don't like using _THREAD_SAFE for this > test, for the reason mentioned above. And I don't like using > _REENTRANT because its so widely used and it could still confure > people. > > The second choice, which is what the current version of the "port" > does, is to put the conflicting headers in different directories, > and require the application to define the order of the include > files to get the right one in. > > There are proglems either way, and I don't really prefer one > over the other. Upon further investigation, I'm not sure I agree with myself on this point anymore. I've been trying to get gimp compiled to look into the reported problem Brian Litzinger had. I notice that glib, gtk+ (both needed for gimp) and gimp itself generate include search paths that include /usr/local/include, which means that the linuxthreads pthread.h will get picked up even if the user wants the uthread version in /usr/include. Maybe having just one pthread.h that pulls in the required headers based on a switch (eg. -DLINUXTHREADS) is the way to go? -- Richard Seamman, Jr. email: d...@tar.com 5182 N. Maple Lane phone: 414-367-5450 Chenequa WI 53058 fax: 414-367-5852 To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-current" in the body of the message