#!/usr/bin/perl use threads; { package MyObj; sub new { my $class = shift; bless [shift], $class } sub DESTROY { warn "Destroying ", shift->[0] } } async { MyObj->new("detach"); sleep 1 }->detach; async { MyObj->new("join"); sleep 2 }->join; MyObj->new("main"); sleep 3;
In reply to Re: Do threads do global destruction?
by choroba
in thread Do threads do global destruction?
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |