summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2014-09-23 23:20:08 +0400
committerIvan Maidanski <ivmai@mail.ru>2014-09-23 23:20:08 +0400
commitd0615e61c920120f4689ae591f731151d5ca8523 (patch)
tree635d33228587d839523908ef7efae8411f1f1a40
parentad2be4bcad9c1de18feef7f8d7ebb98d680f064f (diff)
downloadbdwgc-d0615e61c920120f4689ae591f731151d5ca8523.tar.gz
Fix setup_mark_lock missing prototype
(and do not call it if no parallel marker) * include/private/pthread_support.h (GC_setup_mark_lock): Remove prototype. * misc.c (GC_init): Remove GC_setup_mark_lock call (move it to GC_thr_init). * pthread_support.c (setup_mark_lock): Rename from GC_setup_mark_lock; add prototype (only if PARALLEL_MARK). * pthread_support.c (GC_thr_init): Call setup_mark_lock() unless available_markers_m1 is 0.
-rw-r--r--include/private/pthread_support.h2
-rw-r--r--misc.c3
-rw-r--r--pthread_support.c7
3 files changed, 6 insertions, 6 deletions
diff --git a/include/private/pthread_support.h b/include/private/pthread_support.h
index 017f1941..525a9aac 100644
--- a/include/private/pthread_support.h
+++ b/include/private/pthread_support.h
@@ -148,8 +148,6 @@ GC_INNER_PTHRSTART GC_thread GC_start_rtn_prepare_thread(
struct GC_stack_base *sb, void *arg);
GC_INNER_PTHRSTART void GC_thread_exit_proc(void *);
-GC_INNER void GC_setup_mark_lock(void);
-
#endif /* GC_PTHREADS && !GC_WIN32_THREADS */
#endif /* GC_PTHREAD_SUPPORT_H */
diff --git a/misc.c b/misc.c
index 32cbe249..e76aaafc 100644
--- a/misc.c
+++ b/misc.c
@@ -888,9 +888,6 @@ GC_API void GC_CALL GC_init(void)
/* else */ InitializeCriticalSection (&GC_allocate_ml);
}
# endif /* GC_WIN32_THREADS */
-# if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS)
- GC_setup_mark_lock();
-# endif /* GC_PTHREADS */
# if (defined(MSWIN32) || defined(MSWINCE)) && defined(THREADS)
InitializeCriticalSection(&GC_write_cs);
# endif
diff --git a/pthread_support.c b/pthread_support.c
index db86ec84..9c0d4bc5 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -1031,6 +1031,10 @@ static void fork_child_proc(void)
ptr_t *startp, ptr_t *endp);
#endif
+#ifdef PARALLEL_MARK
+ static void setup_mark_lock(void);
+#endif
+
/* We hold the allocation lock. */
GC_INNER void GC_thr_init(void)
{
@@ -1143,6 +1147,7 @@ GC_INNER void GC_thr_init(void)
} else {
/* Disable true incremental collection, but generational is OK. */
GC_time_limit = GC_TIME_UNLIMITED;
+ setup_mark_lock();
/* If we are using a parallel marker, actually start helper threads. */
start_mark_threads();
}
@@ -2010,7 +2015,7 @@ static pthread_cond_t builder_cv = PTHREAD_COND_INITIALIZER;
}
#endif /* GLIBC_2_19_TSX_BUG */
-GC_INNER void GC_setup_mark_lock(void)
+static void setup_mark_lock(void)
{
# ifdef GLIBC_2_19_TSX_BUG
pthread_mutexattr_t mattr;