You could try having the main thread wait on a shared
variable prior to attempting the join. The easiest way to
do this with using Thread::Queue. Start with:
<code>
use threads;
use Thread::Queue;
my $DONE = Thread::Queue->new();
</code>
Have the thread code end by putting its TID onto the
<i>done</i> queue:
<code>
$DONE->enqueue(threads->tid());
return (...);
</code>
In the main code, wait for the thread to finish before
attempting a <i>join</i>:
<code>
my $tid = $DONE->dequeue();
threads->object($tid)->join();
</code>
To write a respons, access
http://ww
w.cpanforum.com/response_form/2549
To see the full thread, access
http://www.cpan
forum.com/threads/2548
--
You are getting this messages from www.cpanforum.com
To change your subscription information visit http://www.cpanforum.
com/mypan/
|