summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-04-03 17:29:32 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:57 +0200
commitf05be53449cd9497ea876b2d1d62076dc3923f22 (patch)
treebea3f339458c38275a548b7666c8c6fbe6f7d62a /pthread_support.c
parente36738d7aa6375f13053ff16dc55edf64eb95019 (diff)
2011-04-03 Ivan Maidanski <ivmai@mail.ru>
* allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf inside "if (GC_print_stats)" branch. * alloc.c (GC_collect_or_expand): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * headers.c (GC_scratch_alloc): Ditto. * os_dep.c (GC_get_maps, GC_remap, PROTECT, GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Ditto. * alloc.c (min_bytes_allocd): Use GC_log_printf instead of GC_printf for DEBUG_THREADS output. * darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list, GC_stop_world, GC_thread_resume, GC_start_world): Ditto. * pthread_start.c (GC_inner_start_routine): Ditto. * pthread_stop_world.c (GC_suspend_handler, GC_restart_handler, GC_push_all_stacks, GC_suspend_all, GC_stop_world, GC_start_world): Ditto. * pthread_support.c (GC_mark_thread, GC_get_nprocs, GC_start_rtn_prepare_thread, pthread_create): Ditto. * alloc.c (GC_adj_bytes_allocd, GC_maybe_gc, GC_stopped_mark, GC_finish_collection): Reformat code. * pthread_stop_world.c (GC_print_sig_mask): Ditto. * pthread_support.c (GC_thr_init): Ditto. * checksums.c (GC_update_check_page): Use GC_printf() instead of GC_err_printf() for error printing. * checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf instead of GC_printf for logging purposes. * dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of external variable outside from GC_register_dynamic_libraries. * dyn_load.c (GC_register_dynamic_libraries): Don't use sys_errlist value if errno equals to sys_nerr. * dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf instead of GC_printf for DL_VERBOSE output. * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove, GC_init_dyld): Use GC_log_printf instead of GC_printf for DARWIN_DEBUG output. * os_dep.c (catch_exception_raise): Use GC_log_printf instead of GC_printf for DEBUG_EXCEPTION_HANDLING output. * reclaim.c (GC_print_free_list): Move "n" increment out of GC_printf() call.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/pthread_support.c b/pthread_support.c
index c78faea..0f1d924 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -388,8 +388,8 @@ STATIC void * GC_mark_thread(void * id)
my_mark_no = GC_mark_no;
}
# ifdef DEBUG_THREADS
- GC_printf("Starting mark helper for mark number %lu\n",
- (unsigned long)my_mark_no);
+ GC_log_printf("Starting mark helper for mark number %lu\n",
+ (unsigned long)my_mark_no);
# endif
GC_help_marker(my_mark_no);
}
@@ -439,7 +439,7 @@ static void start_mark_threads(void)
}
}
if (GC_print_stats) {
- GC_log_printf("Started %ld mark helper threads\n", GC_markers - 1);
+ GC_log_printf("Started %ld mark helper threads\n", GC_markers - 1);
}
pthread_attr_destroy(&attr);
}
@@ -861,7 +861,7 @@ STATIC void GC_fork_child_proc(void)
numCpus = pm_sysinfo.idle_vp_count;
# ifdef DEBUG_THREADS
- GC_printf("Number of active CPUs in this system: %d\n", numCpus);
+ GC_log_printf("Number of active CPUs in this system: %d\n", numCpus);
# endif
return(numCpus);
}
@@ -984,8 +984,9 @@ GC_INNER void GC_thr_init(void)
}
# ifdef PARALLEL_MARK
if (GC_print_stats) {
- GC_log_printf("Number of processors = %ld, "
- "number of marker threads = %ld\n", GC_nprocs, GC_markers);
+ GC_log_printf(
+ "Number of processors = %ld, number of marker threads = %ld\n",
+ GC_nprocs, GC_markers);
}
if (GC_markers <= 1) {
GC_parallel = FALSE;
@@ -1406,8 +1407,8 @@ GC_INNER void * GC_start_rtn_prepare_thread(void *(**pstart)(void *),
my_pthread = pthread_self();
# ifdef DEBUG_THREADS
- GC_printf("Starting thread 0x%x, pid = %ld, sp = %p\n",
- (unsigned)my_pthread, (long) getpid(), &arg);
+ GC_log_printf("Starting thread 0x%x, pid = %ld, sp = %p\n",
+ (unsigned)my_pthread, (long)getpid(), &arg);
# endif
LOCK();
me = GC_register_my_thread_inner(sb, my_pthread);
@@ -1418,7 +1419,7 @@ GC_INNER void * GC_start_rtn_prepare_thread(void *(**pstart)(void *),
UNLOCK();
*pstart = si -> start_routine;
# ifdef DEBUG_THREADS
- GC_printf("start_routine = %p\n", (void *)(signed_word)(*pstart));
+ GC_log_printf("start_routine = %p\n", (void *)(signed_word)(*pstart));
# endif
*pstart_arg = si -> arg;
sem_post(&(si -> registered)); /* Last action on si. */
@@ -1523,15 +1524,15 @@ GC_API int WRAP_FUNC(pthread_create)(pthread_t *new_thread,
si -> flags = my_flags;
UNLOCK();
# ifdef DEBUG_THREADS
- GC_printf("About to start new thread from thread 0x%x\n",
- (unsigned)pthread_self());
+ GC_log_printf("About to start new thread from thread 0x%x\n",
+ (unsigned)pthread_self());
# endif
GC_need_to_lock = TRUE;
result = REAL_FUNC(pthread_create)(new_thread, attr, GC_start_routine, si);
# ifdef DEBUG_THREADS
- GC_printf("Started thread 0x%x\n", (unsigned)(*new_thread));
+ GC_log_printf("Started thread 0x%x\n", (unsigned)(*new_thread));
# endif
/* Wait until child has been added to the thread table. */
/* This also ensures that we hold onto si until the child is done */