summaryrefslogtreecommitdiff
path: root/ext/Thread/die.tx
blob: 25814162da3e8482f4da45c1d2cb68eb0b753a0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
BEGIN {
    eval { require Config; import Config };
    if ($@) {
	print "1..0 # Skip: no Config\n";
	exit(0);
    }
}

use Thread 'async';

$t = async {
    print "here\n";
    die "success";
    print "shouldn't get here\n";
};

sleep 1;
print "joining...\n";
eval { @r = $t->join; };
if ($@) {
    print "thread died with message: $@";
} else {
    print "thread failed to die successfully\n";
}