2002-03-09 Adam Megacz <adam@xwt.org>
authorAdam Megacz <adam@xwt.org>
Sat, 9 Mar 2002 22:33:49 +0000 (22:33 +0000)
committerAdam Megacz <megacz@gcc.gnu.org>
Sat, 9 Mar 2002 22:33:49 +0000 (22:33 +0000)
        * win32.cc (_CRT_MT, __mingwthr_key_dtor) Added fake
        definitions to simulate -mthreads.

From-SVN: r50515

libjava/ChangeLog
libjava/win32.cc

index 6e7863fed37da07dec281a532f09a0c58388a2af..ad2364093c58a932928fbe429aac9216324a145b 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-09  Adam Megacz  <adam@xwt.org>
+
+        * win32.cc (_CRT_MT, __mingwthr_key_dtor) Added fake
+        definitions to simulate -mthreads.
+       
 2002-03-09  Adam Megacz  <adam@xwt.org>
 
         * win32.cc (_Jv_platform_gettimeofday) Cast 1000 to long long to
index 22139c99f4a421f3bedaac00a45db60e5837210c..57c63789f366c2b91a4093d349ea30181fa6b1bf 100644 (file)
@@ -48,3 +48,17 @@ _Jv_platform_gettimeofday ()
   return t.time * 1000LL + t.millitm;
 }
 
+// The following definitions "fake out" mingw to think that -mthreads
+// was enabled and that mingwthr.dll was linked. GCJ-compiled
+// applications don't need this helper library because we can safely
+// detect thread death (return from Thread.run()).
+
+int _CRT_MT = 1;
+
+extern "C" int
+__mingwthr_key_dtor (DWORD, void (*) (void *))
+{
+  // FIXME: for now we do nothing; this causes a memory leak of
+  //        approximately 24 bytes per thread created.
+  return 0;
+}