]> granicus.if.org Git - gc/commitdiff
Minor code refactoring of GC fork handlers (remove GC prefix)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 20 Nov 2012 16:55:55 +0000 (20:55 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 20 Nov 2012 16:55:55 +0000 (20:55 +0400)
* pthread_support.c (GC_fork_prepare_proc, GC_fork_parent_proc,
GC_fork_child_proc): Declare as "static" instead of STATIC; remove
"GC_" prefix.
* win32_threads.c (GC_fork_prepare_proc, GC_fork_parent_proc,
GC_fork_child_proc): Likewise.
* pthread_support.c (GC_fork_parent_proc): Refine comment.
* pthread_support.c (GC_thr_init): Remove "GC_" prefix for
fork_prepare/parent/child_proc (only if CAN_HANDLE_FORK).
* win32_threads.c (GC_thr_init): Likewise.

pthread_support.c
win32_threads.c

index 84c95fbfcec483d1c6d5ca5f01e8754175270f2b..7b53fe0a477b12ec18c91267673607e29669bb0d 100644 (file)
@@ -941,7 +941,7 @@ IF_CANCEL(static int fork_cancel_state;)
                                 /* protected by allocation lock.        */
 
 /* Called before a fork()               */
-STATIC void GC_fork_prepare_proc(void)
+static void fork_prepare_proc(void)
 {
     /* Acquire all relevant locks, so that after releasing the locks    */
     /* the child will see a consistent state in which monitor           */
@@ -964,8 +964,8 @@ STATIC void GC_fork_prepare_proc(void)
 #     endif
 }
 
-/* Called in parent after a fork()      */
-STATIC void GC_fork_parent_proc(void)
+/* Called in parent after a fork() (even if the latter failed). */
+static void fork_parent_proc(void)
 {
 #   if defined(PARALLEL_MARK)
       if (GC_parallel)
@@ -976,7 +976,7 @@ STATIC void GC_fork_parent_proc(void)
 }
 
 /* Called in child after a fork()       */
-STATIC void GC_fork_child_proc(void)
+static void fork_child_proc(void)
 {
     /* Clean up the thread table, so that just our thread is left. */
 #   if defined(PARALLEL_MARK)
@@ -1010,8 +1010,8 @@ GC_INNER void GC_thr_init(void)
 # ifdef CAN_HANDLE_FORK
     /* Prepare for forks if requested.  */
     if (GC_handle_fork
-        && pthread_atfork(GC_fork_prepare_proc, GC_fork_parent_proc,
-                          GC_fork_child_proc) != 0)
+          && pthread_atfork(fork_prepare_proc, fork_parent_proc,
+                            fork_child_proc) != 0)
       ABORT("pthread_atfork failed");
 # endif
 # ifdef INCLUDE_LINUX_THREAD_DESCR
index 45466beee51a17a979d323313f43641570056df2..4e25bc7118fc00134731958c5ee8d28a902d30ed 100644 (file)
@@ -1048,7 +1048,7 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
 #     endif
     }
 
-    STATIC void GC_fork_prepare_proc(void)
+    static void fork_prepare_proc(void)
     {
       LOCK();
 #     ifdef PARALLEL_MARK
@@ -1062,7 +1062,7 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
 #     endif
     }
 
-    STATIC void GC_fork_parent_proc(void)
+    static void fork_parent_proc(void)
     {
 #     ifdef PARALLEL_MARK
         if (GC_parallel)
@@ -1071,7 +1071,7 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
       UNLOCK();
     }
 
-    STATIC void GC_fork_child_proc(void)
+    static void fork_child_proc(void)
     {
 #     ifdef PARALLEL_MARK
         if (GC_parallel) {
@@ -2405,8 +2405,8 @@ GC_INNER void GC_thr_init(void)
 # ifdef CAN_HANDLE_FORK
     /* Prepare for forks if requested.  */
     if (GC_handle_fork
-        && pthread_atfork(GC_fork_prepare_proc, GC_fork_parent_proc,
-                          GC_fork_child_proc) != 0)
+          && pthread_atfork(fork_prepare_proc, fork_parent_proc,
+                            fork_child_proc) != 0)
       ABORT("pthread_atfork failed");
 # endif