From: Nicholas Clark Date: Wed, 7 Jul 2004 15:14:39 +0000 (+0000) Subject: First stab at explaining that CLONE may get more parameters in future. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38e4e52d5683a57a270cdfb0cd26315320d2b453;p=p5sagit%2Fp5-mst-13.2.git First stab at explaining that CLONE may get more parameters in future. More eloquent rewording desired. Patches welcome. p4raw-id: //depot/perl@23062 --- diff --git a/pod/perlmod.pod b/pod/perlmod.pod index 752d1f3..00cc71a 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -539,11 +539,14 @@ between different threads. These threads can be used by using the C module or by doing fork() on win32 (fake fork() support). When a thread is cloned all Perl data is cloned, however non-Perl data cannot be cloned automatically. Perl after 5.7.2 has support for the C -special subroutine . In C you can do whatever you need to do, +special subroutine. In C you can do whatever you need to do, like for example handle the cloning of non-Perl data, if necessary. -C will be executed once for every package that has it defined -(or inherits it). It will be called in the context of the new thread, -so all modifications are made in the new area. +C will be called once as a class method for every package that has it +defined (or inherits it). It will be called in the context of the new thread, +so all modifications are made in the new area. Currently CLONE is called with +no parameters other than the invocant package name, but code should not assume +that this will remain unchanged, as it is likely that in future extra parameters +will be passed in to give more information about the state of cloning. If you want to CLONE all objects you will need to keep track of them per package. This is simply done using a hash and Scalar::Util::weaken().