From: Gurusamy Sarathy Date: Fri, 14 Jul 2000 08:55:38 +0000 (+0000) Subject: rename totally bletcherous SvLOCK() thingy (doesn't do what the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=631cfb58c2bd693774ee9ffe59908af4423167d4;p=p5sagit%2Fp5-mst-13.2.git rename totally bletcherous SvLOCK() thingy (doesn't do what the name suggests anyway) p4raw-id: //depot/perl@6398 --- diff --git a/ext/IPC/SysV/Makefile.PL b/ext/IPC/SysV/Makefile.PL index b87f179..f994950 100644 --- a/ext/IPC/SysV/Makefile.PL +++ b/ext/IPC/SysV/Makefile.PL @@ -13,7 +13,7 @@ sub MY::libscan return '' if($path =~ m:/(RCS|CVS|SCCS)/: || $path =~ m:[~%]$: || - $path =~ m:(\.(orig|rej)|~)$: + $path =~ m:\.(orig|rej)$: ); $path; diff --git a/sv.h b/sv.h index b77a9d3..c670f80 100644 --- a/sv.h +++ b/sv.h @@ -1022,13 +1022,6 @@ indicated number of bytes (remember to reserve space for an extra trailing NUL character). Calls C to perform the expansion if necessary. Returns a pointer to the character buffer. -=for apidoc Am|void|SvLOCK|SV* sv -Aquires an internal mutex for a SV. Used to make sure multiple threads -don't stomp on the guts of an SV at the same time - -=for apidoc Am|void|SvUNLOCK|SV* sv -Release the internal mutex for an SV. - =cut */ @@ -1064,9 +1057,6 @@ Release the internal mutex for an SV. SvSetSV_nosteal_and(dst,src,SvSETMAGIC(dst)) #ifdef DEBUGGING - -#define SvLOCK(sv) MUTEX_LOCK(&PL_sv_lock_mutex) -#define SvUNLOCK(sv) MUTEX_UNLOCK(&PL_sv_lock_mutex) #define SvPEEK(sv) sv_peek(sv) #else #define SvPEEK(sv) "" diff --git a/thread.h b/thread.h index 8234360..f7ab18c 100644 --- a/thread.h +++ b/thread.h @@ -282,6 +282,8 @@ # define UNLOCK_CRED_MUTEX MUTEX_UNLOCK(&PL_cred_mutex) # define LOCK_FDPID_MUTEX MUTEX_LOCK(&PL_fdpid_mutex) # define UNLOCK_FDPID_MUTEX MUTEX_UNLOCK(&PL_fdpid_mutex) +# define LOCK_SV_LOCK_MUTEX MUTEX_LOCK(&PL_sv_lock_mutex) +# define UNLOCK_SV_LOCK_MUTEX MUTEX_UNLOCK(&PL_sv_lock_mutex) /* Values and macros for thr->flags */ #define THRf_STATE_MASK 7 @@ -385,6 +387,14 @@ typedef struct condpair { # define UNLOCK_FDPID_MUTEX #endif +#ifndef LOCK_SV_LOCK_MUTEX +# define LOCK_SV_LOCK_MUTEX +#endif + +#ifndef UNLOCK_SV_LOCK_MUTEX +# define UNLOCK_SV_LOCK_MUTEX +#endif + /* THR, SET_THR, and dTHR are there for compatibility with old versions */ #ifndef THR # define THR PERL_GET_THX diff --git a/util.c b/util.c index d892e75..df6bbf5 100644 --- a/util.c +++ b/util.c @@ -3502,11 +3502,9 @@ Perl_sv_lock(pTHX_ SV *osv) MAGIC *mg; SV *sv = osv; - SvLOCK(osv); + LOCK_SV_LOCK_MUTEX; if (SvROK(sv)) { sv = SvRV(sv); - SvUNLOCK(osv); - SvLOCK(sv); } mg = condpair_magic(sv); @@ -3523,7 +3521,7 @@ Perl_sv_lock(pTHX_ SV *osv) MUTEX_UNLOCK(MgMUTEXP(mg)); SAVEDESTRUCTOR_X(Perl_unlock_condpair, sv); } - SvUNLOCK(sv); + UNLOCK_SV_LOCK_MUTEX; return sv; }