]> granicus.if.org Git - gc/commitdiff
Recognize GC_SIG_SUSPEND and GC_SIG_THR_RESTART tuning macros in gc.h
authorIvan Maidanski <ivmai@mail.ru>
Sat, 14 Jul 2012 08:51:01 +0000 (12:51 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 14 Jul 2012 08:51:01 +0000 (12:51 +0400)
* include/gc.h (GC_SIG_SUSPEND, GC_SIG_THR_RESTART): New micro
recognized to tune GC_INIT with the non-default signal to be used by
GC to suspend (and resume, respectively) threads (only if GC_THREADS).
* include/gc.h (GC_INIT_CONF_SUSPEND_SIGNAL,
GC_INIT_CONF_THR_RESTART_SIGNAL): New macro (used internally by
GC_INIT).
* include/gc.h (GC_INIT): Invoke GC_INIT_CONF_SUSPEND_SIGNAL and
GC_INIT_CONF_THR_RESTART_SIGNAL before GC_init().

include/gc.h

index 98e1aa4501aacea58d67f6a19cfb6feacf0060a5..8a5546a9367bb9e7cf0569a81cc5dbb250773f5c 100644 (file)
@@ -1556,6 +1556,19 @@ GC_API int GC_CALL GC_get_force_unmap_on_gcollect(void);
 # define GC_INIT_CONF_TIME_LIMIT /* empty */
 #endif
 
+#if defined(GC_SIG_SUSPEND) && defined(GC_THREADS)
+# define GC_INIT_CONF_SUSPEND_SIGNAL GC_set_suspend_signal(GC_SIG_SUSPEND)
+#else
+# define GC_INIT_CONF_SUSPEND_SIGNAL /* empty */
+#endif
+
+#if defined(GC_SIG_THR_RESTART) && defined(GC_THREADS)
+# define GC_INIT_CONF_THR_RESTART_SIGNAL \
+                GC_set_thr_restart_signal(GC_SIG_THR_RESTART)
+#else
+# define GC_INIT_CONF_THR_RESTART_SIGNAL /* empty */
+#endif
+
 #ifdef GC_MAXIMUM_HEAP_SIZE
   /* Limit the heap size to the desired value (useful for debugging).   */
   /* The limit could be overridden either at the program start-up by    */
@@ -1593,6 +1606,8 @@ GC_API int GC_CALL GC_get_force_unmap_on_gcollect(void);
                     GC_INIT_CONF_FREE_SPACE_DIVISOR; \
                     GC_INIT_CONF_FULL_FREQ; \
                     GC_INIT_CONF_TIME_LIMIT; \
+                    GC_INIT_CONF_SUSPEND_SIGNAL; \
+                    GC_INIT_CONF_THR_RESTART_SIGNAL; \
                     GC_INIT_CONF_MAXIMUM_HEAP_SIZE; \
                     GC_init(); /* real GC initialization */ \
                     GC_INIT_CONF_ROOTS; /* post-init */ \