Hello,
Do object filehandles passed into threaded function calls of another
object get destroyed upon a join, or do I need to clean that up? If it
does destroy it, what do I do if I do not want it to? For example, one
object is shared by multiple threaded objects, so I do not want it to go
out of scope with one of the threads using it.
If I create one object like:
my $mail = Mail->new({ to => 'me', from => 'me', smtp => 'ms' });
(It has a sub DESTROY that prints it is getting destroyed)
and I assign it to other objects:
for (my $count = 0; $count < 3; $count++) {
my $connection = Conn->new({ server => 'deathstar', mail => $mail });
...and then I call a function like so:
eval {
threads->new( \&Conn->destroyPlanet,$connection);
};
}
my @threads = threads->list();
while(@threads) { eval { $_->join() };
David Shapiro