Skip site navigation (1) Skip section navigation (2)

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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Date: 2010-08-31 10:40:10
Message-ID: AANLkTim1a=g2q+7n001o7uTpMwpyK-r-KtKH1wkCkFeS@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Aug 31, 2010 at 4:06 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Here's a 2nd version of the "latch" patch. Now with a Windows
> implementation. Comments welcome.

Seems good.

Two minor comments:

> rc = WaitForSingleObject(latch->event, timeout / 1000);
> if (rc == WAIT_FAILED)
> {
> 	ereport(ERROR,
> 		(errcode_for_socket_access(),
> 		 errmsg("WaitForSingleObject() failed: error code %d", (int) GetLastError())));
> }
> if (rc == WAIT_TIMEOUT)
> 	break;		/* timeout exceeded */

We should also check "rc == WAIT_OBJECT_0"?

> static volatile HANDLE waitingEvent = false;

s/false/NULL?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

pgsql-hackers by date

Next:From: Itagaki TakahiroDate: 2010-08-31 11:04:19
Subject: Re: I: About "Our CLUSTER implementation is pessimal" patch
Previous:From: Dave PageDate: 2010-08-31 10:21:25
Subject: Re: huia and moa versus old PG branches

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group