You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Greg Ames <gr...@raleigh.ibm.com> on 2000/11/28 14:41:54 UTC

Re: cvs commit: apr/misc/unix start.c


rbb@locus.apache.org wrote:
> 
[...]
> 
>   +    if (initialized) {
>   +        return APR_SUCCESS;
>   +    }
>   +    initialized++;
>   +

Oooops...this only counts to 1.  Works OK when there's at most 2 APR
users, but what if there are 3?  We don't want to destroy locks when the
second user goes away.  How about:

  if (initialized++) {
      return APR_SUCCESS;

Greg

Re: cvs commit: apr/misc/unix start.c

Posted by rb...@covalent.net.
On Tue, 28 Nov 2000, Greg Ames wrote:

> 
> 
> rbb@locus.apache.org wrote:
> > 
> [...]
> > 
> >   +    if (initialized) {
> >   +        return APR_SUCCESS;
> >   +    }
> >   +    initialized++;
> >   +
> 
> Oooops...this only counts to 1.  Works OK when there's at most 2 APR
> users, but what if there are 3?  We don't want to destroy locks when the
> second user goes away.  How about:
> 
>   if (initialized++) {
>       return APR_SUCCESS;

You're right.  I wrote this section before even thinking about the
termination, and didn't check it after I did the terminating stuff.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------