From: Malcolm Beattie Date: Wed, 10 Sep 1997 16:39:41 +0000 (+0000) Subject: Debugging output for lock handling. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc1f4c8605eb0418d46665ac7ff7e98d88e051ca;p=p5sagit%2Fp5-mst-13.2.git Debugging output for lock handling. p4raw-id: //depot/perl@64 --- diff --git a/mg.c b/mg.c index 305f00f..56fb495 100644 --- a/mg.c +++ b/mg.c @@ -1626,6 +1626,8 @@ SV *sv; MAGIC *mg; { dTHR; + DEBUG_L(PerlIO_printf(PerlIO_stderr(), "0x%lx: magic_mutexfree 0x%lx\n", + (unsigned long)thr, (unsigned long)sv);) if (MgOWNER(mg)) croak("panic: magic_mutexfree"); MUTEX_DESTROY(MgMUTEXP(mg)); diff --git a/pp.c b/pp.c index 6761a1f..01c61c2 100644 --- a/pp.c +++ b/pp.c @@ -4128,6 +4128,8 @@ void *svv; croak("panic: unlock_condpair unlocking mutex that we don't own"); MgOWNER(mg) = 0; COND_SIGNAL(MgOWNERCONDP(mg)); + DEBUG_L(PerlIO_printf(PerlIO_stderr(), "0x%lx: unlock 0x%lx\n", + (unsigned long)thr, (unsigned long)svv);) MUTEX_UNLOCK(MgMUTEXP(mg)); } #endif /* USE_THREADS */ @@ -4150,6 +4152,8 @@ PP(pp_lock) while (MgOWNER(mg)) COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg)); MgOWNER(mg) = thr; + DEBUG_L(PerlIO_printf(PerlIO_stderr(), "0x%lx: pp_lock lock 0x%lx\n", + (unsigned long)thr, (unsigned long)sv);) MUTEX_UNLOCK(MgMUTEXP(mg)); save_destructor(unlock_condpair, sv); } diff --git a/pp_hot.c b/pp_hot.c index fce7437..334a60d 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1897,6 +1897,9 @@ PP(pp_entersub) while (MgOWNER(mg)) COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg)); MgOWNER(mg) = thr; + DEBUG_L(PerlIO_printf(PerlIO_stderr(), + "0x%lx: pp_entersub lock 0x%lx\n", + (unsigned long)thr, (unsigned long)sv);) MUTEX_UNLOCK(MgMUTEXP(mg)); save_destructor(unlock_condpair, sv); } diff --git a/util.c b/util.c index 8fa30a0..6fc5672 100644 --- a/util.c +++ b/util.c @@ -2422,6 +2422,10 @@ SV *sv; mg->mg_ptr = (char *)cp; mg->mg_len = sizeof(cp); MUTEX_UNLOCK(&sv_mutex); + DEBUG_L(WITH_THR(PerlIO_printf(PerlIO_stderr(), + "0x%lx: condpair_magic 0x%lx\n", + (unsigned long)thr, + (unsigned long)sv));) } } return mg;