projects
/
p5sagit/Exception-Guaranteed.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Here goes nothing
[p5sagit/Exception-Guaranteed.git]
/
t
/
__SelfDestruct.pm
1
package __SelfDestruct;
2
3
use warnings;
4
use strict;
5
6
sub spawn_n_kill (&) {
7
{
8
my $x = bless [ $_[1], ($INC{'threads.pm'} ? threads->tid : 0) ];
9
undef $x;
10
}
11
1;
12
}
13
14
sub DESTROY {
15
$_[0]->[0]->() unless ($_[0]->[1] and threads->tid != $_[0]->[1]);
16
}
17
18
1;