5 if ($ENV{'PERL_CORE'}){
7 unshift @INC, '../lib';
10 if (! $Config{'useithreads'}) {
11 print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
16 use ExtUtils::testlib;
19 my ($id, $ok, $name) = @_;
21 # You have to do it this way or VMS will get confused.
23 print("ok $id - $name\n");
25 print("not ok $id - $name\n");
26 printf("# Failed test at line %d\n", (caller)[2]);
34 print("1..18\n"); ### Number of tests that will be run ###
37 use threads ('stack_size' => 32*4096);
40 ### Start of Testing ###
42 ok(2, threads->get_stack_size() == 32*4096,
43 'Stack size set in import');
44 ok(3, threads->set_stack_size(64*4096) == 32*4096,
45 'Set returns previous value');
46 ok(4, threads->get_stack_size() == 64*4096,
51 ok(5, threads->get_stack_size() == 64*4096,
52 'Get stack size in thread');
53 ok(6, threads->self()->get_stack_size() == 64*4096,
54 'Thread gets own stack size');
55 ok(7, threads->set_stack_size(32*4096) == 64*4096,
56 'Thread changes stack size');
57 ok(8, threads->get_stack_size() == 32*4096,
58 'Get stack size in thread');
59 ok(9, threads->self()->get_stack_size() == 64*4096,
60 'Thread stack size unchanged');
64 ok(10, threads->get_stack_size() == 32*4096,
65 'Default thread sized changed in thread');
68 { 'stack' => 64*4096 },
70 ok(11, threads->get_stack_size() == 32*4096,
71 'Get stack size in thread');
72 ok(12, threads->self()->get_stack_size() == 64*4096,
73 'Thread gets own stack size');
77 my $thr = threads->create( { 'stack' => 64*4096 }, sub { } );
81 ok(13, threads->get_stack_size() == 32*4096,
82 'Get stack size in thread');
83 ok(14, threads->self()->get_stack_size() == 64*4096,
84 'Thread gets own stack size');
89 { 'stack' => 48*4096 },
91 ok(15, threads->get_stack_size() == 32*4096,
92 'Get stack size in thread');
93 ok(16, threads->self()->get_stack_size() == 48*4096,
94 'Thread gets own stack size');
95 ok(17, threads->set_stack_size(64*4096) == 32*4096,
96 'Thread changes stack size');
102 ok(18, threads->get_stack_size() == 64*4096,
103 'Default thread sized changed in thread');