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 require threads if $Config{useithreads};
24 # Passes with $nthreads = 1 and with eq_set().
25 # Passes with $nthreads = 2 and with eq_array().
26 # Fails with $nthreads = 2 and with eq_set().
29 if( $Config{useithreads} ) {
30 plan tests => $nthreads;
33 plan skip_all => 'no 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..$nthreads) {
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" );