Forgot to add problems.t with change #18419
Artur Bergman [Sat, 4 Jan 2003 07:43:50 +0000 (07:43 +0000)]
p4raw-link: @18419 on //depot/perl: 0405e91e9230dfa76b6164c6ed64f7dab29ff49a

p4raw-id: //depot/perl@18434

ext/threads/t/problems.t [new file with mode: 0644]

diff --git a/ext/threads/t/problems.t b/ext/threads/t/problems.t
new file mode 100644 (file)
index 0000000..a7b6c34
--- /dev/null
@@ -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;
+
+
+
+
+
+
+