From: Artur Bergman Date: Sat, 4 Jan 2003 07:43:50 +0000 (+0000) Subject: Forgot to add problems.t with change #18419 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da46a8d03fbbb04b232304e31be54ce17218c550;p=p5sagit%2Fp5-mst-13.2.git Forgot to add problems.t with change #18419 p4raw-link: @18419 on //depot/perl: 0405e91e9230dfa76b6164c6ed64f7dab29ff49a p4raw-id: //depot/perl@18434 --- diff --git a/ext/threads/t/problems.t b/ext/threads/t/problems.t new file mode 100644 index 0000000..a7b6c34 --- /dev/null +++ b/ext/threads/t/problems.t @@ -0,0 +1,55 @@ + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require Config; import Config; + unless ($Config{'useithreads'}) { + print "1..0 # Skip: no useithreads\n"; + exit 0; + } +} + +use ExtUtils::testlib; +use strict; +use threads; +use threads::shared; +use Test::More tests => 4; + + +# +# This tests for too much destruction +# which was caused by cloning stashes +# on join which led to double the dataspace +# +######################### + +$|++; +use Devel::Peek; + + +{ + + sub Foo::DESTROY { + my $self = shift; + my ($package, $file, $line) = caller; + is(threads->tid(),$self->{tid}, "In destroy it should be correct too" ) + } + my $foo; + $foo = bless {tid => 0}, 'Foo'; + my $bar = threads->create(sub { + is(threads->tid(),1, "And tid be 10 here"); + $foo->{tid} = 1; + return $foo; + })->join(); + $bar->{tid} = 0; + + +} +1; + + + + + + +