Re: pgsql: Implement error checking for pthreads calls in thread-safe mode.

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Magnus Hagander" <mha(at)postgresql(dot)org>
Cc: <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Implement error checking for pthreads calls in thread-safe mode.
Date: 2008-05-17 11:36:38
Message-ID: 87hccxjh6h.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

"Magnus Hagander" <mha(at)postgresql(dot)org> writes:

> Log Message:
> -----------
> Implement error checking for pthreads calls in thread-safe mode. They really
> should always succeed, but in the likely event of a failure we would
> previously fall through *without locking* - the new code will exit(1).
>
> Printing the error message on stderr will not work for all applications, but
> it's better than nothing at all - and our API doesn't provide a way to return
> the error to the caller.

If you want to print an error I think you have to use write(2) here instead of
fprintf. if pthread is cocked up then fprintf is going to have trouble locking
the buffer.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's On-Demand Production Tuning

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2008-05-17 16:49:23 pgsql: Remove DEFAULT_SYNC_FLAGBIT ...
Previous Message Andrew Dunstan 2008-05-17 02:43:16 pgsql: fix ecpg regression tests broken by over-eager adding of