summaryrefslogtreecommitdiff
path: root/ext/DynaLoader/dl_dlopen.xs
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2009-03-07 14:33:04 -0600
committerCraig A. Berry <craigberry@mac.com>2009-03-07 14:33:04 -0600
commit8c472fc1d477ec4a43d02ce6fc6458f4004c738d (patch)
tree40fc59bd6156fe8297cc48abacba142c15754630 /ext/DynaLoader/dl_dlopen.xs
parent4e71788c753f3f1e3668bcc2e7eae57e95c676e8 (diff)
downloadperl-8c472fc1d477ec4a43d02ce6fc6458f4004c738d.tar.gz
Make DynaLoader clone its private data under threads.
Diffstat (limited to 'ext/DynaLoader/dl_dlopen.xs')
-rw-r--r--ext/DynaLoader/dl_dlopen.xs15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/DynaLoader/dl_dlopen.xs b/ext/DynaLoader/dl_dlopen.xs
index 3332758b63..dfa9d0675a 100644
--- a/ext/DynaLoader/dl_dlopen.xs
+++ b/ext/DynaLoader/dl_dlopen.xs
@@ -264,4 +264,19 @@ dl_error()
OUTPUT:
RETVAL
+#if defined(USE_ITHREADS)
+
+void
+CLONE(...)
+ CODE:
+ MY_CXT_CLONE;
+
+ /* MY_CXT_CLONE just does a memcpy on the whole structure, so to avoid
+ * using Perl variables that belong to another thread, we create our
+ * own for this thread.
+ */
+ MY_CXT.x_dl_last_error = newSVpvn("", 0);
+
+#endif
+
# end.