diff options
-rw-r--r-- | ext/IPC/SysV/Makefile.PL | 2 | ||||
-rw-r--r-- | sv.h | 10 | ||||
-rw-r--r-- | thread.h | 10 | ||||
-rw-r--r-- | util.c | 6 |
4 files changed, 13 insertions, 15 deletions
diff --git a/ext/IPC/SysV/Makefile.PL b/ext/IPC/SysV/Makefile.PL index b87f179be2..f994950d19 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; @@ -1022,13 +1022,6 @@ indicated number of bytes (remember to reserve space for an extra trailing NUL character). Calls C<sv_grow> 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) "" @@ -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 @@ -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; } |