summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorivmai <ivmai>2010-10-22 07:47:47 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commit174c1de6e93ac6308dca45063564e175f280d16a (patch)
treea279bdda159aca36eea58c7b431699f7600383e5 /tests
parent51e969ce8077d27fd0492e7220c2838747a3f3a5 (diff)
2010-10-22 Ivan Maidanski <ivmai@mail.ru>
* CMakeLists.txt: Check enable_parallel_mark on Darwin. * configure.ac: Ditto. * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS, DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and GC_DISCOVER_TASK_THREADS, respectively. * os_dep.c (DARWIN_SUSPEND_GC_THREADS): Ditto. * pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Ditto. * darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define (and remove FIXME). * darwin_stop_world.c (GC_use_threads_discovery): Add GC_API; comment; remove FIXME. * win32_threads.c (GC_NO_DLLMAIN): Rename to GC_NO_THREADS_DISCOVERY. * tests/test.c (GC_NO_DLLMAIN): Ditto. * doc/README.macros (GC_NO_DLLMAIN): Ditto. * doc/README.win32 (GC_NO_DLLMAIN): Ditto. * doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment. * win32_threads.c (GC_win32_dll_threads): Define as macro to true if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY); update the comment. * win32_threads.c (GC_use_DllMain): Rename to GC_use_threads_discovery; do not set GC_win32_dll_threads if GC_DISCOVER_TASK_THREADS. * win32_threads.c (GC_started_thread_while_stopped, GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread, GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions which use GC_win32_dll_threads to minimize the possibility of an "unreachable code" compiler warning when GC_win32_dll_threads is defined as a macro. * win32_threads.c (GC_unregister_my_thread): Don't call GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC (since can't happen); use "t" local variable only if not GC_win32_dll_threads. * win32_threads.c (GC_register_my_thread_inner): Reformat the comment. * doc/README.macros (GC_DISCOVER_TASK_THREADS): Document. * include/gc.h (GC_use_DllMain): Rename to GC_use_threads_discovery but keep old name as a macro definition. * include/gc.h (GC_use_threads_discovery): Declare also for Darwin; update the comment. * tests/test.c (main): Call GC_use_threads_discovery for Darwin (to test the mode if possible). * configure: Regenerate.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/test.c b/tests/test.c
index b221bd3..c2efc82 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -50,7 +50,7 @@
# include "gc_typed.h"
# include "private/gc_priv.h" /* For output, locking, MIN_WORDS, */
- /* and some statistics, and gcconfig.h. */
+ /* some statistics and gcconfig.h. */
# if defined(MSWIN32) || defined(MSWINCE)
# include <windows.h>
@@ -1529,9 +1529,11 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev,
HANDLE win_thr_h;
# endif
DWORD thread_id;
-# if defined(GC_DLL) && !defined(GC_NO_DLLMAIN) && !defined(MSWINCE) \
- && !defined(THREAD_LOCAL_ALLOC) && !defined(PARALLEL_MARK)
- GC_use_DllMain(); /* Test with implicit thread registration if possible. */
+# if defined(GC_DLL) && !defined(GC_NO_THREADS_DISCOVERY) \
+ && !defined(MSWINCE) && !defined(THREAD_LOCAL_ALLOC) \
+ && !defined(PARALLEL_MARK)
+ GC_use_threads_discovery();
+ /* Test with implicit thread registration if possible. */
GC_printf("Using DllMain to track threads\n");
# endif
GC_COND_INIT();
@@ -1644,6 +1646,12 @@ int main(void)
pthread_win32_process_attach_np ();
pthread_win32_thread_attach_np ();
# endif
+# if defined(GC_DARWIN_THREADS) && !defined(GC_NO_THREADS_DISCOVERY) \
+ && !defined(DARWIN_DONT_PARSE_STACK) && !defined(THREAD_LOCAL_ALLOC)
+ /* Test with the Darwin implicit thread registration. */
+ GC_use_threads_discovery();
+ GC_printf("Using Darwin task-threads-based world stop and push\n");
+# endif
GC_COND_INIT();
pthread_attr_init(&attr);