3 # Test to see if we've worked around some wacky sort/threading bug
4 # See [rt.cpan.org 6782]
7 if( $ENV{PERL_CORE} ) {
9 @INC = ('../lib', 'lib');
12 unshift @INC, 't/lib';
20 unless ( $] >= 5.008 && $Config{'useithreads'} &&
21 eval { require threads; 'threads'->import; 1; })
23 print "1..0 # Skip: no threads\n";
29 # Passes with $nthreads = 1 and with eq_set().
30 # Passes with $nthreads = 2 and with eq_array().
31 # Fails with $nthreads = 2 and with eq_set().
34 plan tests => $Num_Threads;
39 my @list = ( 'x', 'yy', 'zzz', 'a', 'bb', 'ccc', 'aaaaa', 'z',
40 'hello', 's', 'thisisalongname', '1', '2', '3',
41 'abc', 'xyz', '1234567890', 'm', 'n', 'p' );
43 print "# kid $kid before eq_set\n";
46 # With eq_set, either crashes or panics
47 eq_set(\@list, \@list2);
48 eq_array(\@list, \@list2);
50 print "# kid $kid exit\n";
55 for my $i (1..$Num_Threads) {
56 my $t = threads->new(\&do_one_thread, $i);
57 print "# parent $$: continue\n";
61 print "# parent $$: waiting for join\n";
63 cmp_ok( $rc, '==', 42, "threads exit status is $rc" );