int veto_cleanup = 0;
MUTEX_LOCK(&create_destruct_mutex);
if (aTHX == PL_curinterp && active_threads != 1) {
- Perl_warn(aTHX_ "A thread exited while %" IVdf " threads were running",
- (IV)active_threads);
+ if (ckWARN_d(WARN_THREADS))
+ Perl_warn(aTHX_ "A thread exited while %" IVdf " threads were running",
+ (IV)active_threads);
veto_cleanup = 1;
}
MUTEX_UNLOCK(&create_destruct_mutex);
SV *sv = POPs;
av_store(params, i, SvREFCNT_inc(sv));
}
- if (SvTRUE(ERRSV)) {
+ if (SvTRUE(ERRSV) && ckWARN_d(WARN_THREADS)) {
Perl_warn(aTHX_ "thread failed to start: %" SVf, ERRSV);
}
FREETMPS;
void
Perl_ithread_CLONE(pTHX_ SV *obj)
{
- if (SvROK(obj))
- {
- ithread *thread = SV_to_ithread(aTHX_ obj);
- }
- else
- {
- Perl_warn(aTHX_ "CLONE %" SVf,obj);
- }
+ if (SvROK(obj)) {
+ ithread *thread = SV_to_ithread(aTHX_ obj);
+ }
+ else if (ckWARN_d(WARN_THREADS)) {
+ Perl_warn(aTHX_ "CLONE %" SVf,obj);
+ }
}
AV*
=item A thread exited while %d threads were running
-(W) When using threaded Perl, a thread (not necessarily the main
+(W threads)(S) When using threaded Perl, a thread (not necessarily the main
thread) exited while there were still other threads running.
Usually it's a good idea to first collect the return values of the
created threads by joining them, and only then exit from the main
=item thread failed to start: %s
-(S) The entry point function of threads->create() failed for some reason.
+(W threads)(S) The entry point function of threads->create() failed for some reason.
=item times not implemented