From: Dave Mitchell Date: Sun, 19 May 2002 00:50:43 +0000 (+0100) Subject: Re: [PATCH threads] revised warnings + more tests + docs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b13eb731a6f240c77f8d04c86f0a14142680f98;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH threads] revised warnings + more tests + docs Message-ID: <20020519005043.F7275@fdgroup.com> p4raw-id: //depot/perl@16689 --- diff --git a/ext/threads/shared/t/cond.t b/ext/threads/shared/t/cond.t index 9601605..8c79347 100644 --- a/ext/threads/shared/t/cond.t +++ b/ext/threads/shared/t/cond.t @@ -10,7 +10,7 @@ BEGIN { } } $|++; -print "1..25\n"; +print "1..29\n"; use strict; @@ -247,3 +247,26 @@ sub ok { } +# test warnings; + +{ + my $warncount = 0; + local $SIG{__WARN__} = sub { $warncount++ }; + + my $lock : shared; + + cond_signal($lock); + ok(1, $warncount == 1, 'get warning on cond_signal'); + cond_broadcast($lock); + ok(2, $warncount == 2, 'get warning on cond_broadcast'); + no warnings 'threads'; + cond_signal($lock); + ok(3, $warncount == 2, 'get no warning on cond_signal'); + cond_broadcast($lock); + ok(4, $warncount == 2, 'get no warning on cond_broadcast'); + + $Base += 4; +} + + +