int veto_cleanup = 0;
MUTEX_LOCK(&create_destruct_mutex);
if (aTHX == PL_curinterp && active_threads != 1) {
- Perl_warn(aTHX_ "Cleanup skipped %d active threads", active_threads);
+ Perl_warn(aTHX_ "A thread exited while %" IVdf " other threads were still running",
+ (IV)active_threads);
veto_cleanup = 1;
}
MUTEX_UNLOCK(&create_destruct_mutex);
}
PUTBACK;
if (SvTRUE(ERRSV)) {
- Perl_warn(aTHX_ "Died:%_",ERRSV);
+ Perl_warn(aTHX_ "Died:%" SVf,ERRSV);
}
FREETMPS;
LEAVE;
}
else
{
- Perl_warn(aTHX_ "CLONE %_",obj);
+ Perl_warn(aTHX_ "CLONE %" SVf,obj);
}
}
/* We have finished with it */
thread->state |= PERL_ITHR_JOINED;
MUTEX_UNLOCK(&thread->mutex);
+ sv_unmagic(SvRV(obj),PERL_MAGIC_shared_scalar);
return retparam;
}
return (AV*)NULL;
ithread *curr_thread;
MUTEX_LOCK(&create_destruct_mutex);
curr_thread = threads;
+ PUSHs( sv_2mortal(ithread_to_SV(aTHX_ NULL, curr_thread, classname, TRUE)));
while(curr_thread) {
- PUSHs( ithread_to_SV(aTHX_ NULL, curr_thread, classname, TRUE));
curr_thread = curr_thread->next;
if(curr_thread == threads)
break;
+ if(curr_thread->state & PERL_ITHR_DETACHED ||
+ curr_thread->state & PERL_ITHR_JOINED)
+ continue;
+ PUSHs( sv_2mortal(ithread_to_SV(aTHX_ NULL, curr_thread, classname, TRUE)));
}
MUTEX_UNLOCK(&create_destruct_mutex);
}