in reply to code executed at end of a thread

From threads POD:

END blocks in threads It is possible to add END blocks to threads by using require or eval w +ith the appropriate code. These END blocks will then be executed when the thre +ad's interpreter is destroyed (i.e., either during a ->join() call, or at p +rogram termination). However, calling any the threads manpage methods in such an END block +will most likely fail (e.g., the application may hang, or generate an error) due + to mutexes that are needed to control functionality within the the thread +s manpage module. For this reason, the use of END blocks in threads is strongly discoura +ged.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^2: code executed at end of a thread
by dk (Chaplain) on Dec 04, 2009 at 21:38 UTC
    Thank you, that's a good advice. I also found SKIP_CLONE with a description that fits ideally, but perl panicks when I use it :)