Skip to content

Commit

Permalink
Remove all the 5005threads specific mutex macros, which are now vesti…
Browse files Browse the repository at this point in the history
…gial.
  • Loading branch information
nwc10 committed May 21, 2009
1 parent d525a7b commit b14647b
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 62 deletions.
2 changes: 0 additions & 2 deletions doio.c
Expand Up @@ -626,15 +626,13 @@ 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);
SvIV_set(sv, 0);
sv = *av_fetch(PL_fdpid,savefd,TRUE);
SvUPGRADE(sv, SVt_IV);
SvIV_set(sv, pid);
UNLOCK_FDPID_MUTEX;
}
#endif

Expand Down
7 changes: 0 additions & 7 deletions hv.c
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions pp_sys.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
40 changes: 0 additions & 40 deletions thread.h
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions util.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions win32/win32.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand All @@ -3127,7 +3124,6 @@ win32_pclose(PerlIO *pf)
childpid = 0;

if (!childpid) {
UNLOCK_FDPID_MUTEX;
errno = EBADF;
return -1;
}
Expand All @@ -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;
Expand Down

0 comments on commit b14647b

Please sign in to comment.