This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: pthread_create -- no callback?
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- To: "Lassi A. Tuura" <lassi dot tuura at cern dot ch>,"Evan Pollan" <evan_pollan at yahoo dot com>
- Cc: <cygwin at cygwin dot com>
- Date: Thu, 15 Nov 2001 20:07:21 +1100
- Subject: Re: pthread_create -- no callback?
- References: <20011114212317.56701.qmail@web21002.mail.yahoo.com> <3BF384BA.B2DD3ECB@cern.ch>
===
----- Original Message -----
From: "Lassi A. Tuura" <lassi.tuura@cern.ch>
To: "Evan Pollan" <evan_pollan@yahoo.com>
Cc: "Robert Collins" <robert.collins@itdomain.com.au>;
<cygwin@cygwin.com>
Sent: Thursday, November 15, 2001 8:02 PM
Subject: Re: pthread_create -- no callback?
> > That's all I needed. My experience is very stale w/ C & C++, but
why didn't I
> > get at least a compilation warning when I passed the reference to
the thread,
> > rather than its value?
>
> Because pthread_t == void *. I am sure cygwin team would accept
> a patch that consistently uses for example an opaque type[*]. I
> suppose it might be a lot of simple-minded editing, but it would
> help catch a lot of trivial errors.
Yes, in fact void * was intended to serve the same purpose (as opposed
to a fully defined struct which the prior implementation had.
> [*] Like this: `struct __pthread; typedef __pthread *pthread_t;'.
Thank you. I've put this in my mail archive and will do a patch at some
point - if noone beats me to it that is :].
> This is all the client side knows about `__pthread', hence it is
> opaque. The struct is defined in the implementation only. Works
> of course only if the implementation really uses structs. From a
> superficial inspection there's a 'pthread' class on cygwin side so
> it would work, but I couldn't quite figure out where the code made
> the transition from pthread_t == void * to pthread_t == pthread *.
Inside cygwin,
pthread_t == class pthread **
Rob
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/