summaryrefslogtreecommitdiff
path: root/cv.h
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2001-05-19 17:19:34 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-25 14:00:06 +0000
commita636914a235cd8650ed6efcb07e302c0332fa638 (patch)
tree5d5155bf61ace50dcfc9a603e87d7560db050953 /cv.h
parentb252981a068fc0bea15fe6e5fadd5a9b194b9d63 (diff)
downloadperl-a636914a235cd8650ed6efcb07e302c0332fa638.tar.gz
Re: CvFILE corruption under ithreads
Message-ID: <20010519161934.A12751@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@10925
Diffstat (limited to 'cv.h')
-rw-r--r--cv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cv.h b/cv.h
index 4ade508671..7fa9400965 100644
--- a/cv.h
+++ b/cv.h
@@ -55,6 +55,11 @@ Returns the stash of the CV.
#define CvXSUBANY(sv) ((XPVCV*)SvANY(sv))->xcv_xsubany
#define CvGV(sv) ((XPVCV*)SvANY(sv))->xcv_gv
#define CvFILE(sv) ((XPVCV*)SvANY(sv))->xcv_file
+#ifdef USE_ITHREADS
+# define CvFILE_set_from_cop(sv, cop) (CvFILE(sv) = savepv(CopFILE(cop)))
+#else
+# define CvFILE_set_from_cop(sv, cop) (CvFILE(sv) = CopFILE(cop))
+#endif
#define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv))
#define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
#define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist