summaryrefslogtreecommitdiff
path: root/pod/perlmod.pod
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2007-11-02 23:59:27 +0000
committerDave Mitchell <davem@fdisolutions.com>2007-11-02 23:59:27 +0000
commit33de8e4aff58f134481d1a594f7a9734709d8ea5 (patch)
tree1663710b3c2995ad948cc332faebd0cf0797d457 /pod/perlmod.pod
parentbe61d08ee327e91edc6bb39a13e0138e0eed393a (diff)
downloadperl-33de8e4aff58f134481d1a594f7a9734709d8ea5.tar.gz
[perl #47045] CLONE_SKIP doesn't result in undef copies
clarify the documentation on CLONE_SKIP, and ensure that the undef value has all its flags cleared p4raw-id: //depot/perl@32213
Diffstat (limited to 'pod/perlmod.pod')
-rw-r--r--pod/perlmod.pod3
1 files changed, 3 insertions, 0 deletions
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index 53f3d21c65..63f0be9d2c 100644
--- a/pod/perlmod.pod
+++ b/pod/perlmod.pod
@@ -581,6 +581,9 @@ Like C<CLONE>, C<CLONE_SKIP> is called once per package; however, it is
called just before cloning starts, and in the context of the parent
thread. If it returns a true value, then no objects of that class will
be cloned; or rather, they will be copied as unblessed, undef values.
+For example: if in the parent there are two references to a single blessed
+hash, then in the child there will be two references to a single undefined
+scalar value instead.
This provides a simple mechanism for making a module threadsafe; just add
C<sub CLONE_SKIP { 1 }> at the top of the class, and C<DESTROY()> will be
now only be called once per object. Of course, if the child thread needs