@@ -40,22+40,27 @@ This module allows you to hook thread destruction without fiddling with the inte
It acts globally on all the threads that may spawn anywhere in your program, with the exception of the main thread.
It acts globally on all the threads that may spawn anywhere in your program, with the exception of the main thread.
+The hook will also be called when pseudo-forks (i.e. processes spawn on Windows for the C<fork> emulation) terminate.
+
=head1 FUNCTIONS
=head1 FUNCTIONS
-=head2 C<register BLOCK>
+=head2 C<register>
+
+ register { ... };
+ ®ister($coderef);
-Specify that the C<BLOCK> will have to be called (in void context, without arguments) every time a thread finishes is job.
+Specify that the given block or code reference C<$coderef> will have to be called (in void context, without arguments) every time a thread finishes its job.
More precisely,
=over 4
=item *
More precisely,
=over 4
=item *
-it will always be called before the join for joined threads ;
+it will always be called before the joining for joined threads ;
=item *
=item *
-it will be called for detached threads only if they terminate before the main thread, and the hook will then fire at C<END> time ;
+it will be called for detached threads if and only if they terminate before the main thread, and the hook will then fire at C<END> time ;