Your program logic is wrong, or at least very weird. The only place where you try to remove elements from your @t array is in SafeExit, and there you remove the wrong elements. You use the global $count variable to remove the elements, but $count never gets reset to 0 so you will basically remove a random element from @t, or at least not a joined element. I recommend using a hash keyed by the thread id over using some array.
Also, looking at the Thread documentation, it clearly recommends the ->eval method over the ->join method if you want to prevent dieing.
In reply to Re: catching Thread Exits - how ?
by Corion
in thread catching Thread Exits - how ?
by opensourcer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |