summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-10-24 22:02:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-10-24 22:02:23 +0000
commitfbfddbdec417cfdf5da1dafa6636a5bc4bd00ceb (patch)
tree981c44d00a07e8db26f6300ebb3263f48b4785c3 /win32
parent76546e0ccfecf7bd5c6eff5b9e323349bbcf0253 (diff)
downloadperl-fbfddbdec417cfdf5da1dafa6636a5bc4bd00ceb.tar.gz
Integrate change #12626 from maintperl;
make DynaLoader threadsafe by moving all statics into interpreter-local space TODO: Netware, OS/2, WinCE p4raw-link: @12626 on //depot/maint-5.6/perl: 512dcce54ea4db665708f91609bdd0a6126d1acd p4raw-id: //depot/perl@12627 p4raw-integrated: from //depot/maint-5.6/perl@12625 'copy in' ext/DynaLoader/dl_beos.xs ext/DynaLoader/dl_dld.xs ext/DynaLoader/dl_dyld.xs ext/DynaLoader/dl_hpux.xs ext/DynaLoader/dl_next.xs ext/DynaLoader/dl_vmesa.xs ext/DynaLoader/dl_vms.xs (@5902..) ext/DynaLoader/dl_dllload.xs (@8789..) 'merge in' ext/DynaLoader/dl_mpeix.xs ext/DynaLoader/dlutils.c win32/dl_win32.xs (@5902..) ext/DynaLoader/dl_dlopen.xs (@8631..) ext/DynaLoader/dl_aix.xs (@9416..) ext/DynaLoader/dl_mac.xs (@12597..)
Diffstat (limited to 'win32')
-rw-r--r--win32/dl_win32.xs27
1 files changed, 17 insertions, 10 deletions
diff --git a/win32/dl_win32.xs b/win32/dl_win32.xs
index fb3e3321f8..69910dd539 100644
--- a/win32/dl_win32.xs
+++ b/win32/dl_win32.xs
@@ -32,21 +32,27 @@ calls.
#include "XSUB.h"
-static SV *error_sv;
+typedef struct {
+ SV * x_error_sv;
+} my_cxtx_t; /* this *must* be named my_cxtx_t */
+
+#define DL_CXT_EXTRA /* ask for dl_cxtx to be defined in dlutils.c */
+#include "dlutils.c" /* SaveError() etc */
+
+#define dl_error_sv (dl_cxtx.x_error_sv)
static char *
OS_Error_String(pTHX)
{
- DWORD err = GetLastError();
- STRLEN len;
- if (!error_sv)
- error_sv = newSVpvn("",0);
- PerlProc_GetOSError(error_sv,err);
- return SvPV(error_sv,len);
+ dMY_CXT;
+ DWORD err = GetLastError();
+ STRLEN len;
+ if (!dl_error_sv)
+ dl_error_sv = newSVpvn("",0);
+ PerlProc_GetOSError(dl_error_sv,err);
+ return SvPV(dl_error_sv,len);
}
-#include "dlutils.c" /* SaveError() etc */
-
static void
dl_private_init(pTHX)
{
@@ -157,7 +163,8 @@ dl_install_xsub(perl_name, symref, filename="$Package")
char *
dl_error()
CODE:
- RETVAL = LastError ;
+ dMY_CXT;
+ RETVAL = dl_last_error;
OUTPUT:
RETVAL