6 skip_all_without_config('useithreads');
7 skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
22 state $upper_char = ord "A";
23 state $lower_char = ord "a";
25 return sprintf "%x", $lower_char++ if shift;
26 return sprintf "%x", $upper_char++;
29 my @threads = map +threads->create(sub {
33 return 0 unless eval "qq(A) =~ qr/\\\p{main::IsA}/";
34 return 0 unless eval "qq(a) =~ qr/\\\p{main::IsA}/i";
39 my $success = $threads[0]->join;
40 $success += $threads[1]->join;
44 "Simultaneous threads worked");
59 sleep(60) unless $which++;
64 return sprintf "%x", ord("C");
67 my $thread0 = threads->create(sub {
69 my $a = \'\p{InLongSleep}\';
74 my $thread1 = threads->create(sub {
77 my $c = \'\p{InQuick}\';
84 "One thread hung on a defn doesn't impinge on other's other defns");
98 sleep(25) unless $which++;
102 my @threads = map +threads->create(sub {
105 my $a = \'\p{InLongSleep}\';
111 $threads[0]->detach();',
112 qr/Thread \d+ terminated abnormally: Timeout waiting for another thread to define "InLongSleep" in regex/,
114 "One thread hung on a definition doesn't delay another indefinitely");