Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libgc
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2005-08-25 17:48:41 +0400
committerZoltan Varga <vargaz@gmail.com>2005-08-25 17:48:41 +0400
commitf392aa93cf3184f8b44eec15b9b4947d22434e61 (patch)
tree044581d8db9f19cf004d5b91beca0761e581b2ca /libgc
parent657baf976f2b2aa9fa7baefe5af6ffe673d1056c (diff)
2005-08-24 Zoltan Varga <vargaz@gmail.com>
* win32_threads.c: If GC_INSIDE_DLL is defined, define the DllMain function for automatic registration of threads with the GC. * configure.in: Add an option for turning GC_INSIDE_DLL on. svn path=/trunk/mono/; revision=48831
Diffstat (limited to 'libgc')
-rw-r--r--libgc/ChangeLog7
-rw-r--r--libgc/configure.in7
-rw-r--r--libgc/win32_threads.c8
3 files changed, 21 insertions, 1 deletions
diff --git a/libgc/ChangeLog b/libgc/ChangeLog
index cc33b834c58..9e82f0ffc5c 100644
--- a/libgc/ChangeLog
+++ b/libgc/ChangeLog
@@ -1,5 +1,12 @@
2005-08-24 Zoltan Varga <vargaz@gmail.com>
+ * win32_threads.c: If GC_INSIDE_DLL is defined, define the DllMain function for automatic registration
+ of threads with the GC.
+
+ * configure.in: Add an option for turning GC_INSIDE_DLL on.
+
+2005-08-25 Zoltan Varga <vargaz@freemail.hu>
+
* solaris_threads.c (GC_thread_register_foreign): Add dummy implementation.
Mon Aug 22 10:41:41 BST 2005 Paolo Molaro <lupus@ximian.com>
diff --git a/libgc/configure.in b/libgc/configure.in
index afe5a14985f..8cbe9322883 100644
--- a/libgc/configure.in
+++ b/libgc/configure.in
@@ -49,6 +49,10 @@ esac
THREADS=$with_libgc_threads
+AC_ARG_ENABLE(win32-dllmain,
+[ --enable-win32-dllmain Define the DllMain function in win32_threads.c even if the collector is not built as a dll],
+)
+
AC_ARG_ENABLE(parallel-mark,
[ --enable-parallel-mark parallelize marking and free list construction],
[case "$THREADS" in
@@ -169,6 +173,9 @@ case "$THREADS" in
AC_DEFINE(GC_WIN32_THREADS)
dnl Wine getenv may not return NULL for missing entry
AC_DEFINE(NO_GETENV)
+ if test "${enable_win32_dllmain}" = yes; then
+ AC_DEFINE(GC_INSIDE_DLL)
+ fi
;;
dgux386)
THREADS=dgux386
diff --git a/libgc/win32_threads.c b/libgc/win32_threads.c
index 681e1c2b82e..3195094cc11 100644
--- a/libgc/win32_threads.c
+++ b/libgc/win32_threads.c
@@ -74,7 +74,13 @@ extern LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info);
int GC_thread_is_registered (void)
{
+#if defined(GC_DLL) || defined(GC_INSIDE_DLL)
+ /* Registered by DllMain */
return 1;
+#else
+ /* FIXME: */
+ return 0;
+#endif
}
/*
@@ -753,7 +759,7 @@ int GC_pthread_detach(pthread_t thread)
* We avoid acquiring locks here, since this doesn't seem to be preemptable.
* Pontus Rydin suggests wrapping the thread start routine instead.
*/
-#ifdef GC_DLL
+#if defined(GC_DLL) || defined(GC_INSIDE_DLL)
BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
{
switch (reason) {