[Patch]: Timer functions

Pierre A. Humblet pierre@phumblet.no-ip.org
Mon Mar 7 17:06:00 GMT 2005


----- Original Message ----- 
From: "Christopher Faylor"
To: <cygwin-patches@cygwin.com>
Sent: Monday, March 07, 2005 11:28 AM
Subject: Re: [Patch]: Timer functions


> On Mon, Mar 07, 2005 at 11:20:40AM -0500, Pierre A. Humblet wrote:
> >----- Original Message ----- 
> >From: "Pierre A. Humblet"
> >Sent: Sunday, March 06, 2005 11:40 PM
> >Subject: Re: [Patch]: Timer functions
> >
> >
> >> At 11:00 PM 3/6/2005 -0500, Christopher Faylor wrote:
> >> >I am puzzled by a couple of things.
> >> >
> >> >Why did you decide to forego using th->detach in favor of (apparently)
> >> >a:
> >> >
> >> >      while (running)
> >> > low_priority_sleep (0);
> >>
> >> These are not directly related. I got into this issue because of the
bug
> >> where cygthreads were not reused. I replaced th->detach by self_release
> >> because that seemed to be the most natural and efficient way
> >> to fix the problem.
> >
> >Also that frees the cygthread when the timer expires, not when it's
> >rearmed (if ever).
>
> The design was that the thread is associated with the timer for as long
> as the timer exists.  The fact that it wasn't being detached when the
> timer was deleted is a bug.

Ah, I didn't realize you were willing to pay that price.

> I don't see any reason to reinvent a less efficient way of detaching
> from the thread when detach should do the job.

Me neither.
So now you detach from the delete call, not from the (rea)arming call.
(The thread was being detached if the timer was rearmed while it was
still timing out.)

Pierre




More information about the Cygwin-patches mailing list