summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-07-11 19:27:48 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-07-11 19:27:48 +0000
commit4755096ec61711c5104ba0b6b9314f32ca0351fe (patch)
tree82996f8fa5485964bdfb76e935857ea9bf4165ea /util.c
parentf05cb5f197f40c7c89d7ac1b0d1fd2e1ac165afe (diff)
downloadperl-4755096ec61711c5104ba0b6b9314f32ca0351fe.tar.gz
integrate cfgperl changes#6293..6324 into mainline
p4raw-link: @6324 on //depot/cfgperl: 81bf48a6dbba4b295dfa172a17ca70b654dbf225 p4raw-link: @6293 on //depot/cfgperl: 6e37ea6052902cde1aeb08a2129ffc7c8ea53736 p4raw-id: //depot/perl@6369 p4raw-branched: from //depot/cfgperl@6368 'branch in' lib/Win32.pod lib/lib_pm.PL p4raw-deleted: from //depot/cfgperl@6368 'delete in' pod/Win32.pod (@5937..) pod/buildtoc (@6091..) lib/lib.pm.PL (@6227..) pod/Makefile (@6232..) p4raw-integrated: from //depot/cfgperl@6368 'copy in' thread.h (@5656..) lib/warnings/register.pm (@5704..) ext/B/B/Stash.pm (@5972..) lib/CGI/Util.pm (@6034..) util.c (@6217..) gv.c (@6244..) pp.c (@6260..) doop.c (@6269..) pod/perlfunc.pod (@6277..) pp_ctl.c (@6293..) makedef.pl (@6301..) embed.h global.sym objXSUB.h perlapi.c proto.h (@6305..) win32/Makefile (@6307..) Makefile.SH (@6309..) t/op/method.t (@6312..) sv.h (@6315..) 'ignore' op.c (@6273..) 'merge in' embed.pl win32/win32.c (@6305..) p4raw-integrated: from //depot/cfgperl@6324 'merge in' toke.c (@6307..) p4raw-branched: from //depot/cfgperl@6323 'branch in' pod/buildtoc.PL (@6319..) p4raw-integrated: from //depot/cfgperl@6323 'copy in' pod/perl.pod (@6319..) pod/perltoc.pod (@6322..) 'merge in' MANIFEST (@6319..) p4raw-branched: from //depot/cfgperl@6319 'branch in' pod/Makefile.SH p4raw-integrated: from //depot/cfgperl@6315 'ignore' pp_hot.c (@6313..) p4raw-integrated: from //depot/cfgperl@6311 'copy in' ext/POSIX/POSIX.pod (@6296..) p4raw-integrated: from //depot/cfgperl@6307 'merge in' doio.c (@6223..)
Diffstat (limited to 'util.c')
-rw-r--r--util.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/util.c b/util.c
index e0f1f14a90..d892e75120 100644
--- a/util.c
+++ b/util.c
@@ -2402,9 +2402,9 @@ Perl_my_popen(pTHX_ char *cmd, char *mode)
PerlLIO_close(p[This]);
p[This] = p[that];
}
- MUTEX_LOCK(&PL_fdpid_mutex);
+ LOCK_FDPID_MUTEX;
sv = *av_fetch(PL_fdpid,p[This],TRUE);
- MUTEX_UNLOCK(&PL_fdpid_mutex);
+ UNLOCK_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
- MUTEX_LOCK(&PL_fdpid_mutex);
+ LOCK_FDPID_MUTEX;
svp = av_fetch(PL_fdpid,PerlIO_fileno(ptr),TRUE);
- MUTEX_UNLOCK(&PL_fdpid_mutex);
+ UNLOCK_FDPID_MUTEX;
pid = SvIVX(*svp);
SvREFCNT_dec(*svp);
*svp = &PL_sv_undef;
@@ -3497,7 +3497,7 @@ Perl_condpair_magic(pTHX_ SV *sv)
}
SV *
-Perl_lock(pTHX_ SV *osv)
+Perl_sv_lock(pTHX_ SV *osv)
{
MAGIC *mg;
SV *sv = osv;
@@ -3513,17 +3513,18 @@ Perl_lock(pTHX_ SV *osv)
MUTEX_LOCK(MgMUTEXP(mg));
if (MgOWNER(mg) == thr)
MUTEX_UNLOCK(MgMUTEXP(mg));
- else {
+ else {
while (MgOWNER(mg))
COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg));
MgOWNER(mg) = thr;
- DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%"UVxf": Perl_lock lock 0x%"UVxf"\n",
+ DEBUG_S(PerlIO_printf(Perl_debug_log,
+ "0x%"UVxf": Perl_lock lock 0x%"UVxf"\n",
PTR2UV(thr), PTR2UV(sv));)
MUTEX_UNLOCK(MgMUTEXP(mg));
SAVEDESTRUCTOR_X(Perl_unlock_condpair, sv);
}
- SvUNLOCK(sv);
- return sv;
+ SvUNLOCK(sv);
+ return sv;
}
/*