Re: Win32 Thread safetyness

From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Win32 Thread safetyness
Date: 2005-08-25 06:18:37
Message-ID: slrndgqolt.2bu6.andrew+nonews@trinity.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2005-08-24, "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> wrote:
> Which relates to:
>
> static unsigned long
> pq_threadidcallback(void)
> {
> return (unsigned long) pthread_self();
> }

This is an abuse of pthread_t - it is explicitly not guaranteed in the spec
that pthread_t is an integer type, or even a scalar type; it's permitted to
be a structure. The only valid operations on pthread_t values are assignment
and passing to functions (including pthread_equal() for equality comparison).

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Glaesemann 2005-08-25 06:50:43 Re: TODO list comments
Previous Message Tom Lane 2005-08-25 06:09:10 Re: TODO questions