diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-11 17:42:04 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-11 17:42:04 +0000 |
commit | 9d8fd706bc0a9872712899ee2dadb932fa21142a (patch) | |
tree | 2294f09adaee42fb5263353788bf81563c38eb0d | |
parent | 153141c23cb8c100f3a68211170e1ecf65713557 (diff) | |
download | perl-9d8fd706bc0a9872712899ee2dadb932fa21142a.tar.gz |
integrate cfgperl change#6217 into mainline
p4raw-link: @6217 on //depot/cfgperl: cc9b67681954df413fe79f7c379e7b91a3121259
p4raw-id: //depot/perl@6347
-rw-r--r-- | doio.c | 4 | ||||
-rw-r--r-- | sv.h | 7 | ||||
-rw-r--r-- | util.c | 8 | ||||
-rw-r--r-- | vmesa/vmesa.c | 16 | ||||
-rw-r--r-- | win32/win32.c | 8 |
5 files changed, 18 insertions, 25 deletions
@@ -476,13 +476,13 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, SV *sv; PerlLIO_dup2(PerlIO_fileno(fp), fd); - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(PL_fdpid,PerlIO_fileno(fp),TRUE); (void)SvUPGRADE(sv, SVt_IV); pid = SvIVX(sv); SvIVX(sv) = 0; sv = *av_fetch(PL_fdpid,fd,TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); (void)SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; if (!was_fdopen) @@ -1066,10 +1066,3 @@ Release the internal mutex for an SV. #define SvGROW(sv,len) (SvLEN(sv) < (len) ? sv_grow(sv,len) : SvPVX(sv)) #define Sv_Grow sv_grow -#ifdef USE_THREADS -# define FDPID_LOCK MUTEX_LOCK(&PL_fdpid_mutex) -# define FDPID_UNLOCK MUTEX_UNLOCK(&PL_fdpid_mutex) -#else -# define FDPID_LOCK -# define FDPID_UNLOCK -#endif @@ -2402,9 +2402,9 @@ Perl_my_popen(pTHX_ char *cmd, char *mode) PerlLIO_close(p[This]); p[This] = p[that]; } - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(PL_fdpid,p[This],TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); (void)SvUPGRADE(sv,SVt_IV); SvIVX(sv) = pid; PL_forkprocess = pid; @@ -2622,9 +2622,9 @@ Perl_my_pclose(pTHX_ PerlIO *ptr) int saved_win32_errno; #endif - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); svp = av_fetch(PL_fdpid,PerlIO_fileno(ptr),TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); pid = SvIVX(*svp); SvREFCNT_dec(*svp); *svp = &PL_sv_undef; diff --git a/vmesa/vmesa.c b/vmesa/vmesa.c index b39638086f..0e4ad86682 100644 --- a/vmesa/vmesa.c +++ b/vmesa/vmesa.c @@ -182,13 +182,13 @@ do_aspawn(SV* really, SV **mark, SV **sp) /* be used by my_pclose */ /*---------------------------------------------*/ close(fd); - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); p_sv = av_fetch(PL_fdpid,fd,TRUE); fd = (int) SvIVX(*p_sv); SvREFCNT_dec(*p_sv); *p_sv = &PL_sv_undef; sv = *av_fetch(PL_fdpid,fd,TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; status = 0; @@ -414,9 +414,9 @@ my_popen(char *cmd, char *mode) pid = spawn_cmd(cmd, Perl_stdin_fd, Perl_stdout_fd); if (pid >= 0) { - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(PL_fdpid,pFd[this],TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; fd = PerlIO_fdopen(pFd[this], mode); @@ -427,9 +427,9 @@ my_popen(char *cmd, char *mode) } else { - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(PL_fdpid,pFd[that],TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pFd[this]; fd = PerlIO_fdopen(pFd[this], mode); @@ -466,9 +466,9 @@ my_pclose(FILE *fp) SV **sv; FILE *other; - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv = av_fetch(PL_fdpid,PerlIO_fileno(fp),TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); pid = (int) SvIVX(*sv); SvREFCNT_dec(*sv); *sv = &PL_sv_undef; diff --git a/win32/win32.c b/win32/win32.c index c94d4c5126..6e336169bc 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2393,9 +2393,9 @@ win32_popen(const char *command, const char *mode) /* close saved handle */ win32_close(oldfd); - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv_setiv(*av_fetch(w32_fdpid, p[parent], TRUE), childpid); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); /* set process id so that it can be returned by perl's open() */ PL_forkprocess = childpid; @@ -2431,9 +2431,9 @@ win32_pclose(FILE *pf) int childpid, status; SV *sv; - FDPID_LOCK; + MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(w32_fdpid, win32_fileno(pf), TRUE); - FDPID_UNLOCK; + MUTEX_UNLOCK(&PL_fdpid_mutex); if (SvIOK(sv)) childpid = SvIVX(sv); else |