MUTEX_LOCK(&thread->mutex);
if (thread->count != 0) {
MUTEX_UNLOCK(&thread->mutex);
- return;
+ return;
}
- MUTEX_UNLOCK(&thread->mutex);
MUTEX_LOCK(&create_mutex);
/* Remove from circular list of threads */
if (thread->next == thread) {
thread->interp = NULL;
}
PERL_SET_CONTEXT(aTHX);
+ MUTEX_UNLOCK(&thread->mutex);
}
{
dTHXa(thread->interp);
- clone_param.flags = 0;
+ clone_param.flags = 0;
thread->init_function = sv_dup(init_function, &clone_param);
if (SvREFCNT(thread->init_function) == 0) {
SvREFCNT_inc(thread->init_function);
- }
+ }
thread->params = sv_dup(params, &clone_param);
SvREFCNT_inc(thread->params);
ptr_table_free(PL_ptr_table);
PL_ptr_table = NULL;
}
-
+
PERL_SET_CONTEXT(aTHX);
/* Start the thread */
#endif
}
#endif
- MUTEX_UNLOCK(&create_mutex);
+ MUTEX_UNLOCK(&create_mutex);
return ithread_to_SV(aTHX_ obj, thread, classname, FALSE);
}
MUTEX_UNLOCK(&create_mutex);
}
-