Change 30221 by [EMAIL PROTECTED] on 2007/02/12 10:52:28
Note why storing a reference as an integer in %^H is not threadsafe.
Affected files ...
... //depot/perl/pod/perlpragma.pod#6 edit
Differences ...
==== //depot/perl/pod/perlpragma.pod#6 (text) ====
Index: perl/pod/perlpragma.pod
--- perl/pod/perlpragma.pod#5~28435~ 2006-06-27 07:01:30.000000000 -0700
+++ perl/pod/perlpragma.pod 2007-02-12 02:52:28.000000000 -0800
@@ -138,3 +138,10 @@
The deletion of a hash key from C<%^H> is recorded, and as ever can be
distinguished from the existence of a key with value C<undef> with
C<exists>.
+
+B<Don't> attempt to store references to data structures as integers which
+are retrieved via C<caller> and converted back, as this will not be threadsafe.
+Accesses would be to the structure without locking (which is not safe for
+Perl's scalars), and either the structure has to leak, or it has to be
+freed when its creating thread terminates, which may be before the optree
+referencing it is deleted, if other threads outlive it.
End of Patch.