blob: f6b695520f9ed24d4e2e5b6a90a033c0c3ad278f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use Thread 'async';
$t = async {
sleep 1;
print "here\n";
die "success if preceded by 'thread died...'";
print "shouldn't get here\n";
};
print "joining...\n";
@r = eval { $t->join; };
if ($@) {
print "thread died with message: $@";
} else {
print "thread failed to die successfully\n";
}
|