$result = $t->join;
$result = $t->eval;
$t->detach;
+ $flags = $t->flags;
+
+ if ($t->done) {
+ $t->join;
+ }
if($t->equal($another_thread)) {
# ...
my $tid = Thread->self->tid;
my $tlist = Thread->list;
+
lock($scalar);
yield();
program will have a tid of zero, while subsequent threads will have tids
assigned starting with one.
+=item flags
+
+The C<flags> method returns the flags for the thread. This is the
+integer value corresponding to the internal flags for the thread, and
+the value man not be all that meaningful to you.
+
+=item done
+
+The C<done> method returns true if the thread you're checking has
+finished, and false otherwise.
+
=back
=head1 LIMITATIONS
SvREFCNT_dec(PL_lastscream);
SvREFCNT_dec(PL_defoutgv);
Safefree(PL_reg_poscache);
+ thr->thr_done = 1;
MUTEX_LOCK(&thr->mutex);
DEBUG_S(PerlIO_printf(Perl_debug_log,
#endif
void
+done(t)
+ Thread t
+ PPCODE:
+#ifdef USE_THREADS
+ PUSHs(t->thr_done ? &PL_sv_yes : &PL_sv_no);
+#endif
+
+void
self(classname)
char * classname
PREINIT:
Perl_utf8_hop
Perl_utf8_to_bytes
Perl_bytes_to_utf8
+Perl_utf8_to_uv_simple
Perl_utf8_to_uv
-Perl_utf8_to_uv_chk
Perl_uv_to_utf8
Perl_warn
Perl_vwarn
thr->tid = 0;
thr->next = thr;
thr->prev = thr;
+ thr->thr_done = 0;
MUTEX_UNLOCK(&PL_threads_mutex);
#ifdef HAVE_THREAD_INTERN
#endif
PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */
-
+PERLVAR(thr_done, bool) /* True when the thread has finished */
#endif /* USE_THREADS */
thr->specific = newAV();
thr->errsv = newSVpvn("", 0);
thr->flags = THRf_R_JOINABLE;
+ thr->thr_done = 0;
MUTEX_INIT(&thr->mutex);
JMPENV_BOOTSTRAP;