diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-11-20 20:55:55 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-11-20 20:55:55 +0400 |
commit | 47e3714fd5b9e05c7b590dc4b5ee54489cfaf721 (patch) | |
tree | a683c94da3c8b300626c9b4c776c50d8a3ed7363 /pthread_support.c | |
parent | 3607bcdd6c33fa7271120a1ca3ac911b692eac35 (diff) | |
download | bdwgc-47e3714fd5b9e05c7b590dc4b5ee54489cfaf721.tar.gz |
Minor code refactoring of GC fork handlers (remove GC prefix)
* 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.
Diffstat (limited to 'pthread_support.c')
-rw-r--r-- | pthread_support.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pthread_support.c b/pthread_support.c index 84c95fbf..7b53fe0a 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -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 |