Re: Introduce timeout capability for ConditionVariableSleep - Mailing list pgsql-hackers

From Shawn Debnath
Subject Re: Introduce timeout capability for ConditionVariableSleep
Date
Msg-id 20190321182049.GA95415@f01898859afd.ant.amazon.com
Whole thread Raw
In response to Re: Introduce timeout capability for ConditionVariableSleep  (Shawn Debnath <sdn@amazon.com>)
Responses Re: Introduce timeout capability for ConditionVariableSleep
List pgsql-hackers
On Sat, Mar 16, 2019 at 03:27:17PM -0700, Shawn Debnath wrote:
> > +     * Track the current time so that we can calculate the 
> > remaining timeout
> > +     * if we are woken up spuriously.
> > 
> > I think tha "track" means chasing a moving objects. So it might
> > be bettter that it is record or something?
> > 
> > >   * Wait for the given condition variable to be signaled or till timeout.
> > >   *
> > >   * Returns -1 when timeout expires, otherwise returns 0.
> > >   *
> > >   * See ConditionVariableSleep() for general usage.
> > > 
> > > > +ConditionVariableTimedSleep(ConditionVariable *cv, long timeout,
> > > > 
> > > > Counldn't the two-state return value be a boolean?
> 
> I will change it to Record in the next iteration of the patch.

Posting rebased and updated patch. Changed the word 'Track' to 'Record' 
and also changed variable name rem_timeout to cur_timeout to match 
naming in other use cases.


-- 
Shawn Debnath
Amazon Web Services (AWS)

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Pluggable Storage - Andres's take
Next
From: Simon Riggs
Date:
Subject: Re: Connections hang indefinitely while taking a gin index's LWLockbuffer_content lock