Commit | Line | Data |
0fcb073c |
1 | BEGIN { |
2 | eval { require Config; import Config }; |
3 | if ($@) { |
4 | print "1..0 # Skip: no Config\n"; |
5 | exit(0); |
6 | } |
7 | if ($Config{extensions} !~ /\bThread\b/) { |
8 | print "1..0 # Skip: no use5005threads\n"; |
9 | exit(0); |
10 | } |
11 | } |
12 | |
3487771d |
13 | use Thread 'async'; |
14 | |
15 | $t = async { |
16 | sleep 1; |
17 | print "here\n"; |
18 | die "success if preceded by 'thread died...'"; |
19 | print "shouldn't get here\n"; |
20 | }; |
21 | |
22 | print "joining...\n"; |
23 | @r = eval { $t->join; }; |
24 | if ($@) { |
25 | print "thread died with message: $@"; |
26 | } else { |
27 | print "thread failed to die successfully\n"; |
28 | } |