Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!) - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Date
Msg-id 1284399796.17708.1.camel@jdavis-ux.asterdata.local
Whole thread Raw
In response to Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
List pgsql-hackers
On Mon, 2010-09-13 at 09:10 +0300, Heikki Linnakangas wrote:
> > but we should be consistent and document that:
> >   (a) it shouldn't happen
> >   (b) that it's just a sanity check and we're ignoring the race
> 
> Would this be sufficient?
> 
> --- a/src/backend/port/unix_latch.c
> +++ b/src/backend/port/unix_latch.c
> @@ -156,6 +156,7 @@ OwnLatch(volatile Latch *latch)
>       if (selfpipe_readfd == -1)
>           initSelfPipe();
> 
> +    /* sanity check */
>       if (latch->owner_pid != 0)
>           elog(ERROR, "latch already owned");
>       latch->owner_pid = MyProcPid;
> 
> Or you want to suggest something better?

Perfect. I was just slightly confused reading it the first time, and I
think that would have cleared it up.

Thanks,Jeff Davis




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Report: removing the inconsistencies in our CVS->git conversion
Next
From: Heikki Linnakangas
Date:
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)