summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-01-13 16:53:47 +0100
committerIvan Maidanski <ivmai@mail.ru>2012-01-16 13:39:08 +0100
commit9cab08ec1a863515de17affebe82257bcbd94ece (patch)
tree79af0f82500f72b235b996d253cf7be151a3ca93 /win32_threads.c
parent8e7acd91f5bdb5cff78765303571af6f971bc9f2 (diff)
Fix extra/gc.c to enable GC source inclusion from multi-threaded app
* extra/gc.c: Include gc_pthread_redirects.h (unless GC_NO_THREAD_REDIRECTS) to restore thread calls macro-based redirection after the corresponding undef's in pthread_support.c. * win32_threads.c: Restore thread calls macro-based redirection (unless GC_NO_THREAD_REDIRECTS) at the file end. * extra/gc.c: Remove "file not well tested" comment.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 69817c8..ca9976e 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -2737,4 +2737,14 @@ GC_INNER void GC_init_parallel(void)
#endif /* THREAD_LOCAL_ALLOC ... */
+# ifndef GC_NO_THREAD_REDIRECTS
+ /* Restore thread calls redirection. */
+# define CreateThread GC_CreateThread
+# define ExitThread GC_ExitThread
+# undef _beginthreadex
+# define _beginthreadex GC_beginthreadex
+# undef _endthreadex
+# define _endthreadex GC_endthreadex
+# endif /* !GC_NO_THREAD_REDIRECTS */
+
#endif /* GC_WIN32_THREADS */