PerlInterpreter *freeperl = NULL;
MUTEX_LOCK(&thread->mutex);
if (!thread->next) {
+ MUTEX_UNLOCK(&thread->mutex);
Perl_croak(aTHX_ "panic: destruct destroyed thread %p (%s)",thread, why);
}
if (thread->count != 0) {
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;
MUTEX_LOCK(&create_destruct_mutex);
- thread = PerlMemShared_malloc(sizeof(ithread));
+ thread = (ithread *) PerlMemShared_malloc(sizeof(ithread));
if (!thread) {
MUTEX_UNLOCK(&create_destruct_mutex);
PerlLIO_write(PerlIO_fileno(Perl_error_log),
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*
MUTEX_INIT(&create_destruct_mutex);
MUTEX_LOCK(&create_destruct_mutex);
PL_threadhook = &Perl_ithread_hook;
- thread = PerlMemShared_malloc(sizeof(ithread));
+ thread = (ithread *) PerlMemShared_malloc(sizeof(ithread));
if (!thread) {
PerlLIO_write(PerlIO_fileno(Perl_error_log),
PL_no_mem, strlen(PL_no_mem));
=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 5.005 threads are deprecated