]> granicus.if.org Git - gc/commitdiff
2010-09-03 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Fri, 3 Sep 2010 05:31:51 +0000 (05:31 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:54 +0000 (21:06 +0400)
* doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo.
* darwin_stop_world.c (GC_use_mach_handler_thread): Change type
to GC_bool.
* darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
Simplify the expressions involving GC_use_mach_handler_thread.
* darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
Initialize GC_use_mach_handler_thread to TRUE (instead of 1).

ChangeLog
darwin_stop_world.c
doc/README.macros

index cdf04ad96a96525bd0468a7c8b4d530ffdfe32c4..66cfd8d4fd244d0b2705abc0b36cf5cdb97b66cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-03  Ivan Maidanski <ivmai@mail.ru>
+
+       * doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo.
+       * darwin_stop_world.c (GC_use_mach_handler_thread): Change type
+       to GC_bool.
+       * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
+       Simplify the expressions involving GC_use_mach_handler_thread.
+       * darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
+       Initialize GC_use_mach_handler_thread to TRUE (instead of 1).
+
 2010-09-02  Ivan Maidanski <ivmai@mail.ru>
 
        * include/gc_pthread_redirects.h (GC_pthread_sigmask, GC_dlopen,
@@ -78,7 +88,7 @@
        Declare new types if needed.
        * pthread_support.c (GC_pthread_cancel, GC_pthread_exit): New
        function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE).
-       * pthread_support.c (GC_init_real_syms): Initialise pointers to
+       * pthread_support.c (GC_init_real_syms): Initialize pointers to
        the "real" pthread_cancel and pthread_exit (only if
        GC_PTHREAD_EXIT_ATTRIBUTE).
        * pthread_support.c (GC_unregister_my_thread): Enable collections
 
 2010-03-23  Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)
 
-       * Makefile.am (check_LTLIBRARIES): Initialise to empty.
+       * Makefile.am (check_LTLIBRARIES): Initialize to empty.
        * tests/tests.am (TESTS, check_PROGRAMS): Add staticrootstest.
        * tests/tests.am (staticrootstest_SOURCES, staticrootstest_LDADD,
        libstaticrootslib_la_SOURCES, libstaticrootslib_la_LIBADD,
index 224a78952bbcd31a62754ee2c10efa3de26c0c56..86486cb5fe815494ce57655f021d2a4a36852810 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996 by Silicon Graphics.  All rights reserved.
  * Copyright (c) 1998 by Fergus Henderson.  All rights reserved.
- * Copyright (c) 2000-2009 by Hewlett-Packard Development Company.
+ * Copyright (c) 2000-2010 by Hewlett-Packard Development Company.
  * All rights reserved.
  *
  * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
@@ -419,7 +419,7 @@ GC_INNER void GC_push_all_stacks(void)
 #endif /* !DARWIN_DONT_PARSE_STACK */
 
 STATIC mach_port_t GC_mach_handler_thread = 0;
-STATIC int GC_use_mach_handler_thread = 0;
+STATIC GC_bool GC_use_mach_handler_thread = FALSE;
 
 static struct GC_mach_thread GC_mach_threads[THREAD_TABLE_SZ];
 STATIC int GC_mach_threads_count = 0;
@@ -466,10 +466,8 @@ STATIC int GC_suspend_thread_list(thread_act_array_t act_list, int count,
       changed = 1;
     }
 
-    if (thread != my_thread
-        && (!GC_use_mach_handler_thread
-            || (GC_use_mach_handler_thread
-                && GC_mach_handler_thread != thread))) {
+    if (thread != my_thread && (!GC_use_mach_handler_thread
+                                || GC_mach_handler_thread != thread)) {
       struct thread_basic_info info;
       mach_msg_type_number_t outCount = THREAD_INFO_MAX;
       kern_return_t kern_result = thread_info(thread, THREAD_BASIC_INFO,
@@ -636,15 +634,14 @@ GC_INNER void GC_start_world(void)
     kern_result = task_threads(my_task, &act_list, &listcount);
     for(i = 0; i < listcount; i++) {
       thread_act_t thread = act_list[i];
-      if (thread != my_thread
-          && (!GC_use_mach_handler_thread
-              || (GC_use_mach_handler_thread
-                  && GC_mach_handler_thread != thread))) {
+      if (thread != my_thread && (!GC_use_mach_handler_thread
+                                  || GC_mach_handler_thread != thread)) {
         for(j = 0; j < GC_mach_threads_count; j++) {
           if (thread == GC_mach_threads[j].thread) {
             if (GC_mach_threads[j].already_suspended) {
 #             ifdef DEBUG_THREADS
-                GC_printf("Not resuming already suspended thread %p\n", thread);
+                GC_printf("Not resuming already suspended thread %p\n",
+                        thread);
 #             endif
               continue;
             }
@@ -653,8 +650,8 @@ GC_INNER void GC_start_world(void)
             if(kern_result != KERN_SUCCESS)
               ABORT("thread_info failed");
 #           ifdef DEBUG_THREADS
-              GC_printf("Thread state for 0x%lx = %d\n", (unsigned long)thread,
-                         info.run_state);
+              GC_printf("Thread state for 0x%lx = %d\n",
+                        (unsigned long)thread, info.run_state);
               GC_printf("Resuming 0x%lx\n", (unsigned long)thread);
 #           endif
             /* Resume the thread */
@@ -678,7 +675,7 @@ GC_INNER void GC_start_world(void)
 GC_INNER void GC_darwin_register_mach_handler_thread(mach_port_t thread)
 {
   GC_mach_handler_thread = thread;
-  GC_use_mach_handler_thread = 1;
+  GC_use_mach_handler_thread = TRUE;
 }
 
 #endif
index 3e582e023dfb3d24363f4d6438d1677ac47d4353..e9dfb6f5275cb811132d88f393b53966ac52d8a5 100644 (file)
@@ -437,7 +437,7 @@ ENABLE_TRACE    Enables the GC_TRACE=addr environment setting to do its job.
 
 DARWIN_DONT_PARSE_STACK         Causes the Darwin port to discover thread
   stack bounds in the same way as other pthread ports, without trying to
-  walk the frames onthe stack.  This is recommended only as a fallback for
+  walk the frames on the stack.  This is recommended only as a fallback for
   applications that don't support proper stack unwinding.
 
 USE_PROC_FOR_LIBRARIES  Causes the Linux collector to treat writable