From: Nicholas Clark Date: Thu, 21 May 2009 08:55:37 +0000 (+0200) Subject: Remove all the 5005threads specific mutex macros, which are now vestigial. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b14647bbef65df1555e337714aa22f1e154a4462;p=p5sagit%2Fp5-mst-13.2.git Remove all the 5005threads specific mutex macros, which are now vestigial. --- diff --git a/doio.c b/doio.c index 0e46582..8a12268 100644 --- a/doio.c +++ b/doio.c @@ -626,7 +626,6 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw, Pid_t pid; SV *sv; - LOCK_FDPID_MUTEX; sv = *av_fetch(PL_fdpid,fd,TRUE); SvUPGRADE(sv, SVt_IV); pid = SvIVX(sv); @@ -634,7 +633,6 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw, sv = *av_fetch(PL_fdpid,savefd,TRUE); SvUPGRADE(sv, SVt_IV); SvIV_set(sv, pid); - UNLOCK_FDPID_MUTEX; } #endif diff --git a/hv.c b/hv.c index e3dee46..a6b4448 100644 --- a/hv.c +++ b/hv.c @@ -2324,13 +2324,10 @@ S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash) shared hek */ assert (he->shared_he_he.hent_hek == hek); - LOCK_STRTAB_MUTEX; if (he->shared_he_he.he_valu.hent_refcount - 1) { --he->shared_he_he.he_valu.hent_refcount; - UNLOCK_STRTAB_MUTEX; return; } - UNLOCK_STRTAB_MUTEX; hash = HEK_HASH(hek); } else if (len < 0) { @@ -2352,7 +2349,6 @@ S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash) } */ xhv = (XPVHV*)SvANY(PL_strtab); /* assert(xhv_array != 0) */ - LOCK_STRTAB_MUTEX; first = oentry = &(HvARRAY(PL_strtab))[hash & (I32) HvMAX(PL_strtab)]; if (he) { const HE *const he_he = &(he->shared_he_he); @@ -2387,7 +2383,6 @@ S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash) } } - UNLOCK_STRTAB_MUTEX; if (!entry && ckWARN_d(WARN_INTERNAL)) Perl_warner(aTHX_ packWARN(WARN_INTERNAL), "Attempt to free non-existent shared string '%s'%s" @@ -2452,7 +2447,6 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags) */ /* assert(xhv_array != 0) */ - LOCK_STRTAB_MUTEX; entry = (HvARRAY(PL_strtab))[hindex]; for (;entry; entry = HeNEXT(entry)) { if (HeHASH(entry) != hash) /* strings can't be equal */ @@ -2510,7 +2504,6 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags) } ++entry->he_valu.hent_refcount; - UNLOCK_STRTAB_MUTEX; if (flags & HVhek_FREEKEY) Safefree(str); diff --git a/pp_sys.c b/pp_sys.c index bcd99a5..23f79ba 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -242,7 +242,6 @@ S_emulate_eaccess(pTHX_ const char* path, Mode_t mode) const Gid_t egid = getegid(); int res; - LOCK_CRED_MUTEX; #if !defined(HAS_SETREUID) && !defined(HAS_SETRESUID) Perl_croak(aTHX_ "switching effective uid is not implemented"); #else @@ -288,7 +287,6 @@ S_emulate_eaccess(pTHX_ const char* path, Mode_t mode) #endif #endif Perl_croak(aTHX_ "leaving effective gid failed"); - UNLOCK_CRED_MUTEX; return res; } diff --git a/thread.h b/thread.h index 3a059b5..3b84f36 100644 --- a/thread.h +++ b/thread.h @@ -412,46 +412,6 @@ # define COND_DESTROY(c) #endif -#ifndef LOCK_SV_MUTEX -# define LOCK_SV_MUTEX -#endif - -#ifndef UNLOCK_SV_MUTEX -# define UNLOCK_SV_MUTEX -#endif - -#ifndef LOCK_STRTAB_MUTEX -# define LOCK_STRTAB_MUTEX -#endif - -#ifndef UNLOCK_STRTAB_MUTEX -# define UNLOCK_STRTAB_MUTEX -#endif - -#ifndef LOCK_CRED_MUTEX -# define LOCK_CRED_MUTEX -#endif - -#ifndef UNLOCK_CRED_MUTEX -# define UNLOCK_CRED_MUTEX -#endif - -#ifndef LOCK_FDPID_MUTEX -# define LOCK_FDPID_MUTEX -#endif - -#ifndef UNLOCK_FDPID_MUTEX -# 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 - #ifndef LOCK_DOLLARZERO_MUTEX # define LOCK_DOLLARZERO_MUTEX #endif diff --git a/util.c b/util.c index 782ffde..469a9da 100644 --- a/util.c +++ b/util.c @@ -2347,9 +2347,7 @@ Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args) else PerlLIO_close(p[that]); /* close child's end of pipe */ - LOCK_FDPID_MUTEX; sv = *av_fetch(PL_fdpid,p[This],TRUE); - UNLOCK_FDPID_MUTEX; SvUPGRADE(sv,SVt_IV); SvIV_set(sv, pid); PL_forkprocess = pid; @@ -2517,9 +2515,7 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode) else PerlLIO_close(p[that]); - LOCK_FDPID_MUTEX; sv = *av_fetch(PL_fdpid,p[This],TRUE); - UNLOCK_FDPID_MUTEX; SvUPGRADE(sv,SVt_IV); SvIV_set(sv, pid); PL_forkprocess = pid; @@ -2863,9 +2859,7 @@ Perl_my_pclose(pTHX_ PerlIO *ptr) bool close_failed; dSAVEDERRNO; - LOCK_FDPID_MUTEX; svp = av_fetch(PL_fdpid,PerlIO_fileno(ptr),TRUE); - UNLOCK_FDPID_MUTEX; pid = (SvTYPE(*svp) == SVt_IV) ? SvIVX(*svp) : -1; SvREFCNT_dec(*svp); *svp = &PL_sv_undef; diff --git a/win32/win32.c b/win32/win32.c index cef828b..2397f5c 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3075,9 +3075,7 @@ win32_popen(const char *command, const char *mode) lock_held = 0; } - LOCK_FDPID_MUTEX; sv_setiv(*av_fetch(w32_fdpid, p[parent], TRUE), childpid); - UNLOCK_FDPID_MUTEX; /* set process id so that it can be returned by perl's open() */ PL_forkprocess = childpid; @@ -3118,7 +3116,6 @@ win32_pclose(PerlIO *pf) int childpid, status; SV *sv; - LOCK_FDPID_MUTEX; sv = *av_fetch(w32_fdpid, PerlIO_fileno(pf), TRUE); if (SvIOK(sv)) @@ -3127,7 +3124,6 @@ win32_pclose(PerlIO *pf) childpid = 0; if (!childpid) { - UNLOCK_FDPID_MUTEX; errno = EBADF; return -1; } @@ -3138,7 +3134,6 @@ win32_pclose(PerlIO *pf) fclose(pf); #endif SvIVX(sv) = 0; - UNLOCK_FDPID_MUTEX; if (win32_waitpid(childpid, &status, 0) == -1) return -1;