develooper Front page | perl.perl5.porters | Postings from November 2013

[perl #119089] Shared references (threads::shared) disappear on sub return

Thread Previous | Thread Next
From:
Tony Cook via RT
Date:
November 15, 2013 00:14
Subject:
[perl #119089] Shared references (threads::shared) disappear on sub return
Message ID:
rt-4.0.18-1913-1384474477-568.119089-15-0@perl.org
On Fri Oct 04 06:10:26 2013, dom wrote:
> Hmm, I can't see the subsequent question from Dave on this ticket. I'd 
> be interested in knowing about it even if there isn't an answer for it 
> yet, since this patch is queued for a Debian point release update in a 
> bid to fix the original regression. If there are sufficient remaining 
> uncertainties about the patch, it may be better to revert it before the 
> point release.

I think he meant:

https://rt.perl.org/Ticket/Display.html?id=119089#txn-1243579

I'm not sure about the correctness of the patch, but I think Dave's "why doesn't
this break" code example isn't correct, it should be:

  use threads ();
  use threads::shared;
  #use Devel::Peek;
  my $r;
  {
      my @a :shared;
      $r = \$a[0];
      #Dump $r;
  }
  
  $$r = 1; # changed this line

which does break.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=119089

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About