Re: Win32 Thread safetyness - Mailing list pgsql-hackers

From Andrew - Supernews
Subject Re: Win32 Thread safetyness
Date
Msg-id slrndgqolt.2bu6.andrew+nonews@trinity.supernews.net
Whole thread Raw
In response to Win32 Thread safetyness  ("Dave Page" <dpage@vale-housing.co.uk>)
List pgsql-hackers
On 2005-08-24, "Dave Page" <dpage@vale-housing.co.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TODO questions
Next
From: Michael Glaesemann
Date:
Subject: Re: TODO list comments