summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-10-16 10:44:59 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commit51e969ce8077d27fd0492e7220c2838747a3f3a5 (patch)
tree4c4d0adbb2ab08b69564d57370fc402b32cc18d5 /os_dep.c
parentcd96e6d94fec7b53c5af5b2e85814a946448d7e3 (diff)
2010-10-16 Ivan Maidanski <ivmai@mail.ru>
* darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS, DARWIN_QUERY_TASK_THREADS): New macro recognized. * darwin_stop_world.c (GC_query_task_threads): add STATIC; initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS or DARWIN_QUERY_TASK_THREADS; remove FIXME. * darwin_stop_world.c (GC_use_threads_discovery): New function (for setting GC_query_task_threads value). * darwin_stop_world.c (GC_mach_handler_thread, GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS, GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list, GC_darwin_register_mach_handler_thread): Define only if not DARWIN_SUSPEND_GC_THREADS. * darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude the code for GC_query_task_threads case from compilation unless DARWIN_SUSPEND_GC_THREADS. * os_dep.c (GC_darwin_register_mach_handler_thread): Declared only if Darwin threads and not DARWIN_SUSPEND_GC_THREADS. * os_dep.c (GC_mprotect_thread): Call GC_darwin_register_mach_handler_thread only if THREADS and not DARWIN_SUSPEND_GC_THREADS. * pthread_support.c (marker_mach_threads): Don't define if DARWIN_SUSPEND_GC_THREADS. * pthread_support.c (GC_mark_thread): Don't fill in marker_mach_threads if DARWIN_SUSPEND_GC_THREADS. * include/private/gc_locks.h (GC_need_to_lock): Always declare for THREADS case.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/os_dep.c b/os_dep.c
index d822638..6bbba1b 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -3886,13 +3886,15 @@ GC_INNER void GC_mprotect_resume(void)
GC_mprotect_thread_notify(ID_RESUME);
}
+# ifndef DARWIN_SUSPEND_GC_THREADS
+ GC_INNER void GC_darwin_register_mach_handler_thread(mach_port_t thread);
+# endif
+
#else /* !THREADS */
/* The compiler should optimize away any GC_mprotect_state computations */
-#define GC_mprotect_state GC_MP_NORMAL
+# define GC_mprotect_state GC_MP_NORMAL
#endif
-GC_INNER void GC_darwin_register_mach_handler_thread(mach_port_t thread);
-
STATIC void *GC_mprotect_thread(void *arg)
{
mach_msg_return_t r;
@@ -3908,10 +3910,11 @@ STATIC void *GC_mprotect_thread(void *arg)
mach_msg_body_t msgh_body;
char data[1024];
} msg;
-
mach_msg_id_t id;
- GC_darwin_register_mach_handler_thread(mach_thread_self());
+# if defined(THREADS) && !defined(DARWIN_SUSPEND_GC_THREADS)
+ GC_darwin_register_mach_handler_thread(mach_thread_self());
+# endif
for(;;) {
r = mach_msg(&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE |