On Wed, Feb 27, 2008 at 08:15:36AM -0800, Dean Arnold wrote:
> As to shared object destruction:
> 
> pre-5.10.0: once per thread, requires some extra bookkeeping to make sure
> it "does the right thing"
> 
> 5.10.0: once in the last referencing thread (fixed in CORE)

Huh?

    use warnings;
    use strict;

    use threads;
    use threads::shared;

    sub DESTROY { warn "DESTROY $_[0]\n" }

    my $h = bless {};
    share $h;
    threads->new(sub {})->join;

$ perl5100t /tmp/p
DESTROY main=HASH(0x98fb844)
DESTROY main=HASH(0x98748c4)
$ 


-- 
I before E. Except when it isn't.

Reply via email to