]> granicus.if.org Git - gc/commitdiff
Support GC_Create/ExitThread, GC_begin/endthreadex for Cygwin and
authorIvan Maidanski <ivmai@mail.ru>
Tue, 15 Nov 2011 16:29:45 +0000 (20:29 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 15 Nov 2011 16:29:45 +0000 (20:29 +0400)
win32-pthread

* include/gc.h (GC_CreateThread, GC_ExitThread, GC_uintptr_t,
GC_beginthreadex, GC_endthreadex): Also declare (and redirect) for
GC_PTHREADS during GC build or if the client includes windows.h before
gc.h file; add a comment.
* win32_threads.c (thread_args, GC_win32_start_inner, GC_win32_start,
GC_CreateThread, GC_ExitThread, GC_beginthreadex, GC_endthreadex):
Also define for GC_PTHREADS.

include/gc.h
win32_threads.c

index b2727a6a8ffce95d1ec6d6210c6772854a83a2fe..f67e4eaa6cdcf77eb4c3ffb1e3d1f524b734ebfe 100644 (file)
@@ -1277,7 +1277,10 @@ typedef int (GC_CALLBACK * GC_has_static_roots_func)(
 GC_API void GC_CALL GC_register_has_static_roots_callback(
                                         GC_has_static_roots_func);
 
-#if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
+#if defined(GC_WIN32_THREADS) \
+    && (!defined(GC_PTHREADS) || defined(GC_BUILD) || defined(WINAPI))
+                /* Note: for Cygwin and win32-pthread, this is skipped  */
+                /* unless windows.h is included before gc.h.            */
 
 # ifndef GC_NO_THREAD_DECLS
 
index 8a401bc228e4fe28cabb06e43af28eb54865e661..c9d4c0f2144ce5fdc3a705d55189fd7eed568e81 100644 (file)
@@ -2000,8 +2000,6 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
 
 #endif /* PARALLEL_MARK */
 
-#ifndef GC_PTHREADS
-
   /* We have no DllMain to take care of new threads.  Thus we   */
   /* must properly intercept thread creation.                   */
 
@@ -2155,8 +2153,6 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
 
 # endif /* !MSWINCE */
 
-#endif /* !GC_PTHREADS */
-
 #ifdef GC_WINMAIN_REDIRECT
   /* This might be useful on WinCE.  Shouldn't be used with GC_DLL.     */