From: Gurusamy Sarathy Date: Fri, 7 May 1999 20:28:31 +0000 (+0000) Subject: avoid using PL_sv_mutex in condpair_magic() (avoids hangs when X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28a8573f881e85e383be4ba96e6a3626f81ca78a;p=p5sagit%2Fp5-mst-13.2.git avoid using PL_sv_mutex in condpair_magic() (avoids hangs when intervening code has to allocate SVs) p4raw-id: //depot/perl@3324 --- diff --git a/util.c b/util.c index 3db5b02..f39ccd1 100644 --- a/util.c +++ b/util.c @@ -2824,11 +2824,11 @@ condpair_magic(SV *sv) COND_INIT(&cp->owner_cond); COND_INIT(&cp->cond); cp->owner = 0; - LOCK_SV_MUTEX; + MUTEX_LOCK(&PL_cred_mutex); /* XXX need separate mutex? */ mg = mg_find(sv, 'm'); if (mg) { /* someone else beat us to initialising it */ - UNLOCK_SV_MUTEX; + MUTEX_UNLOCK(&PL_cred_mutex); /* XXX need separate mutex? */ MUTEX_DESTROY(&cp->mutex); COND_DESTROY(&cp->owner_cond); COND_DESTROY(&cp->cond); @@ -2839,7 +2839,7 @@ condpair_magic(SV *sv) mg = SvMAGIC(sv); mg->mg_ptr = (char *)cp; mg->mg_len = sizeof(cp); - UNLOCK_SV_MUTEX; + MUTEX_UNLOCK(&PL_cred_mutex); /* XXX need separate mutex? */ DEBUG_S(WITH_THR(PerlIO_printf(PerlIO_stderr(), "%p: condpair_magic %p\n", thr, sv));) }