Web lists-archives.com

Re: [Mingw-users] GCC-4.9.3 is now our current release

Hello Ralph!

On Thu, Mar 17, 2016 at 10:29 PM, ralph engels <ralphengels@xxxxxxxxx> wrote:
> Ok one bug it seems
>   __gthread_objc_thread_id (void)
>   {
>     if (__gthread_active_p ())
> +#ifdef PTW32_VERSION
> +    return (objc_thread_t) __gthrw_(pthread_self) ().x; // was pointer
> to handle needs to be pointer to scalar
> ...

Let me start with my standard disclaimer that I know nothing about

But this seems fishy to me.

I assume that pthread_self returns a pthread_t, which is:

   typedef struct {
       void * p;                   /* Pointer to actual object */
       unsigned int x;             /* Extra information - reuse count etc */
   } ptw32_handle_t;

I find it hard to believe that the __gthread_objc_thread_id should
be the x member ("Extra information - reuse count etc").  That
doesn't seem to be a very plausible thread id.  The p member
("Pointer to actual object") I could believe could serve as a thread

That still leaves the question as to why pthreads wants to use
the whole structure -- both the p and x members together -- as the
thread id, but maybe p alone is good enough.  But x alone seems
unlikely to be able to act as a unique identifier for a specific thread,
objective-c, or not.

Again, just guesswork on my part, but using x alone does seem


K. Frank

Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe