OpenBSD sometimes gets -0, probably due to fp fuzziness..
[p5sagit/p5-mst-13.2.git] / ext / threads / t / problems.t
CommitLineData
da46a8d0 1
2BEGIN {
3 chdir 't' if -d 't';
974ec8aa 4 push @INC, '../lib';
da46a8d0 5 require Config; import Config;
6 unless ($Config{'useithreads'}) {
7 print "1..0 # Skip: no useithreads\n";
8 exit 0;
9 }
10}
11
12use ExtUtils::testlib;
13use strict;
14use threads;
15use threads::shared;
16use Test::More tests => 4;
17
18
19#
20# This tests for too much destruction
21# which was caused by cloning stashes
22# on join which led to double the dataspace
23#
24#########################
25
26$|++;
27use Devel::Peek;
28
29
30{
31
32 sub Foo::DESTROY {
33 my $self = shift;
34 my ($package, $file, $line) = caller;
35 is(threads->tid(),$self->{tid}, "In destroy it should be correct too" )
36 }
37 my $foo;
38 $foo = bless {tid => 0}, 'Foo';
39 my $bar = threads->create(sub {
40 is(threads->tid(),1, "And tid be 10 here");
41 $foo->{tid} = 1;
42 return $foo;
43 })->join();
44 $bar->{tid} = 0;
45
46
47}
481;
49
50
51
52
53
54
55