mse local_mark_stack[LOCAL_MARK_STACK_SIZE];
/* Note: local_mark_stack is quite big (up to 128 KiB). */
- if (!GC_parallel) return;
-
+ GC_ASSERT(GC_parallel);
GC_acquire_mark_lock();
while (GC_mark_no < my_mark_no
|| (!GC_help_wanted && GC_mark_no == my_mark_no)) {
}
# endif /* !NO_MARKER_SPECIAL_SIGMASK */
+# ifdef CAN_HANDLE_FORK
+ /* To have proper GC_parallel value in GC_help_marker. */
+ GC_markers_m1 = available_markers_m1;
+# endif
for (i = 0; i < available_markers_m1; ++i) {
if (0 != REAL_FUNC(pthread_create)(GC_mark_threads + i, &attr,
GC_mark_thread, (void *)(word)i)) {
WARN("Marker thread creation failed, errno = %" WARN_PRIdPTR "\n",
errno);
/* Don't try to create other marker threads. */
+ GC_markers_m1 = i;
break;
}
}
- GC_markers_m1 = i;
# ifndef NO_MARKER_SPECIAL_SIGMASK
/* Restore previous signal mask. */
}
# endif /* !NO_MARKER_SPECIAL_SIGMASK */
+# ifdef CAN_HANDLE_FORK
+ /* To have proper GC_parallel value in GC_help_marker. */
+ GC_markers_m1 = available_markers_m1;
+# endif
for (i = 0; i < available_markers_m1; ++i) {
marker_last_stack_min[i] = ADDR_LIMIT;
if (0 != pthread_create(&new_thread, &attr,
GC_mark_thread, (void *)(word)i)) {
WARN("Marker thread creation failed\n", 0);
/* Don't try to create other marker threads. */
+ GC_markers_m1 = i;
break;
}
}
- GC_markers_m1 = i;
# ifndef NO_MARKER_SPECIAL_SIGMASK
/* Restore previous signal mask. */