From: Artur Bergman Date: Wed, 24 Oct 2001 18:06:34 +0000 (+0000) Subject: We need to do sharedsv_find in the original perl context. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f70d29d46197eb7d07bc904ce576f576f115adef;p=p5sagit%2Fp5-mst-13.2.git We need to do sharedsv_find in the original perl context. p4raw-id: //depot/perl@12623 --- diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs index 9263825..cf6c41e 100644 --- a/ext/threads/shared/shared.xs +++ b/ext/threads/shared/shared.xs @@ -43,7 +43,6 @@ int shared_sv_store_mg (pTHX_ SV* sv, MAGIC *mg) { SHAREDSvLOCK(shared); if(SvROK(SHAREDSvGET(shared))) Perl_sharedsv_thrcnt_dec(aTHX_ (shared_sv*) SvIV(SvRV(SHAREDSvGET(shared)))); - SHAREDSvEDIT(shared); if(SvROK(sv)) { shared_sv* target = Perl_sharedsv_find(aTHX_ SvRV(sv)); if(!target) { @@ -52,10 +51,12 @@ int shared_sv_store_mg (pTHX_ SV* sv, MAGIC *mg) { SHAREDSvUNLOCK(shared); Perl_croak(aTHX_ "You cannot assign a non shared reference to a shared scalar"); } + SHAREDSvEDIT(shared); Perl_sv_free(PL_sharedsv_space,SHAREDSvGET(shared)); SHAREDSvGET(shared) = newRV_noinc(newSViv((IV)target)); } else { - sv_setsv(SHAREDSvGET(shared), sv); + SHAREDSvEDIT(shared); + sv_setsv(SHAREDSvGET(shared), sv); } shared->index++; mg->mg_private = shared->index;