* in perl_destruct. It waits until it's the only thread and then
* performs END blocks and other process clean-ups.
*/
- DEBUG_L(fprintf(stderr, "thread_destruct: 0x%lx\n", (unsigned long) thr));
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "thread_destruct: 0x%lx\n", (unsigned long) thr));
Safefree(thr);
MUTEX_LOCK(&nthreads_mutex);
MUTEX_LOCK(&nthreads_mutex);
while (nthreads > 1)
{
- DEBUG_L(fprintf(stderr, "perl_destruct: waiting for %d threads\n",
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "perl_destruct: waiting for %d threads\n",
nthreads - 1));
COND_WAIT(&nthreads_cond, &nthreads_mutex);
}
/* At this point, we're the last thread */
MUTEX_UNLOCK(&nthreads_mutex);
- DEBUG_L(fprintf(stderr, "perl_destruct: armageddon has arrived\n"));
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "perl_destruct: armageddon has arrived\n"));
MUTEX_DESTROY(&nthreads_mutex);
COND_DESTROY(&nthreads_cond);
#endif /* !defined(FAKE_THREADS) */
dTHR;
#endif /* DEBUGGING */
- DEBUG_L((fprintf(stderr, "0x%lx unsetting CvOWNER of 0x%lx:%s\n",
+ DEBUG_L((PerlIO_printf(PerlIO_stderr(), "0x%lx unsetting CvOWNER of 0x%lx:%s\n",
(unsigned long)thr, (unsigned long)cv, SvPEEK((SV*)cv))));
MUTEX_LOCK(CvMUTEXP(cv));
DEBUG_L(if (CvDEPTH(cv) != 0)
/* We already have a clone to use */
MUTEX_UNLOCK(CvMUTEXP(cv));
cv = *(CV**)svp;
- DEBUG_L(fprintf(stderr,
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(),
"entersub: 0x%lx already has clone 0x%lx:%s\n",
(unsigned long) thr, (unsigned long) cv,
SvPEEK((SV*)cv)));
CvOWNER(cv) = thr;
SvREFCNT_inc(cv);
MUTEX_UNLOCK(CvMUTEXP(cv));
- DEBUG_L(fprintf(stderr,
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(),
"entersub: 0x%lx grabbing 0x%lx:%s in stash %s\n",
(unsigned long) thr, (unsigned long) cv,
SvPEEK((SV*)cv), CvSTASH(cv) ?
CV *clonecv;
SvREFCNT_inc(cv); /* don't let it vanish from under us */
MUTEX_UNLOCK(CvMUTEXP(cv));
- DEBUG_L((fprintf(stderr,
+ DEBUG_L((PerlIO_printf(PerlIO_stderr(),
"entersub: 0x%lx cloning 0x%lx:%s\n",
(unsigned long) thr, (unsigned long) cv,
SvPEEK((SV*)cv))));
GV *gv;
CV *cv;
- DEBUG_L(fprintf(stderr, "die: curstack = %p, mainstack= %p\n",
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "die: curstack = %p, mainstack= %p\n",
curstack, mainstack));/*debug*/
/* We have to switch back to mainstack or die_where may try to pop
* the eval block from the wrong stack if die is being called from a
message = mess(pat, &args);
va_end(args);
- DEBUG_L(fprintf(stderr, "die: message = %s\ndiehook = %p\n",
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "die: message = %s\ndiehook = %p\n",
message, diehook));/*debug*/
if (diehook) {
/* sv_2cv might call croak() */
}
restartop = die_where(message);
- DEBUG_L(fprintf(stderr,
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(),
"die: restartop = %p, was_in_eval = %d, oldrunlevel = %d\n",
restartop, was_in_eval, oldrunlevel));/*debug*/
if ((!restartop && was_in_eval) || oldrunlevel > 1)
message = mess(pat, &args);
va_end(args);
#ifdef USE_THREADS
- DEBUG_L(fprintf(stderr, "croak: 0x%lx %s", (unsigned long) thr, message));
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "croak: 0x%lx %s", (unsigned long) thr, message));
#endif /* USE_THREADS */
if (diehook) {
/* sv_2cv might call croak() */