* 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
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>
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
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
int GC_thread_is_registered (void)
{
+#if defined(GC_DLL) || defined(GC_INSIDE_DLL)
+ /* Registered by DllMain */
return 1;
+#else
+ /* FIXME: */
+ return 0;
+#endif
}
/*
* 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) {