perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Fix perl/ithreads random failures
Date Wed, 08 Dec 2004 15:31:01 GMT
Gisle Aas wrote:
> I had to do tests with an older version of mod_perl_1.99 that still
> had the perl/ithreads* tests.  I see that these tests was removed from
> the distribution in [1], but I think that if you apply the attached
> patch you can start distribution these tests again.
> 
> [1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
> 
> Regards,
> Gisle
> 
> 
> Index: t/response/TestPerl/ithreads.pm
> --- t/response/TestPerl/ithreads.pm.~1~	Wed Dec  8 03:43:55 2004
> +++ t/response/TestPerl/ithreads.pm	Wed Dec  8 03:43:55 2004
> @@ -57,7 +57,10 @@
>                                     $counter_shar += $counter_shar for 1..10;
>                                 });
>          $counter_priv += $counter_priv for 1..10;
> -        $counter_shar += $counter_shar for 1..10;
> +        {
> +	    lock $counter_shar;
> +	    $counter_shar += $counter_shar for 1..10;
> +	}
>          $thr->join;
>          ok t_cmp(2**20, $counter_shar, "shared counter");
>          ok t_cmp(2**10, $counter_priv, "private counter");
> End of Patch.

Right on, Gisle. I was locking it inside the child-threads, but forgot 
about the parent. Thanks.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message