#endif /* _AMIGA && !GC_AMIGA_MAKINGLIB */
-typedef void (GC_CALLBACK * GC_exit_func)(const int status);
+typedef void (GC_CALLBACK * GC_exit_func)(int /* status */);
-GC_API void GC_CALL GC_set_exit_func(GC_exit_func fn);
+GC_API void GC_CALL GC_set_exit_func(GC_exit_func);
-typedef void (GC_CALLBACK * GC_abort_func)(const char * const msg);
-
-GC_API void GC_CALL GC_set_abort_func(GC_abort_func fn);
-
-#if defined(GC_LINUX_THREADS)
-GC_API void GC_CALL GC_set_suspend_signal(const int sig);
-GC_API void GC_CALL GC_set_thr_restart_signal(const int sig);
-#endif
+typedef void (GC_CALLBACK * GC_abort_func)(char * /* msg */);
+GC_API void GC_CALL GC_set_abort_func(GC_abort_func);
#ifdef __cplusplus
} /* end of extern "C" */
#endif /* GC_PTHREADS */
+# if !defined(GC_ATTR_NORETURN)
+ # if defined(__GNUC__) /* since GCC v2.7 */
+# define GC_ATTR_NORETURN __attribute__((__noreturn__))
+# elif defined(__NORETURN) /* used in Solaris */
+# define GC_ATTR_NORETURN __NORETURN
+# else
+# define GC_ATTR_NORETURN /* empty */
+# endif
+# endif
+
#endif
# ifdef PCR
# define EXIT() PCR_Base_Exit(1,PCR_waitForever)
# else
- GC_API_PRIV void GC_exit(int status);
+ GC_API_PRIV void GC_exit(int status) GC_ATTR_NORETURN;
# define EXIT() GC_exit(1)
# endif
# define SIG_SUSPEND SIGLOST
# else
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
-# define SIG_SUSPEND GC_get_suspend_signal()
-# define SIG_THR_RESTART GC_get_thr_restart_signal()
-# define SIG_SUSPEND_DEFAULT SIGPWR
-# define SIG_THR_RESTART_DEFAULT SIGXCPU
+# define SIG_SUSPEND SIGPWR
# endif
# elif !defined(GC_OPENBSD_THREADS) && !defined(GC_DARWIN_THREADS)
# if defined(_SIGRTMIN)
#ifdef THREADS
-STATIC int suspend_signal = SIG_SUSPEND_DEFAULT;
-STATIC int thread_restart_signal = SIG_THR_RESTART_DEFAULT;
-
-void GC_set_suspend_signal(const int sig)
-{
- if (GC_is_initialized) return;
- suspend_signal = sig;
-}
-
-void GC_set_thread_restart_signal(const int sig)
-{
- if (GC_is_initialized) return;
- thread_restart_signal = sig;
-}
-
-
- GC_API int GC_CALL GC_get_suspend_signal(void)
- {
-# ifdef SIG_SUSPEND
- return suspend_signal;
-# else
- return -1;
-# endif
- }
-
- GC_API int GC_CALL GC_get_thr_restart_signal(void)
- {
-# ifdef SIG_THR_RESTART
- return thread_restart_signal;
-# else
+# if defined(GC_DARWIN_THREADS) || defined(GC_WIN32_THREADS)
+ GC_API int GC_CALL GC_get_thr_restart_signal(void)
+ {
return -1; /* GC does not use signals to restart threads. */
-# endif
- }
-
+ }
+# endif
#endif /* THREADS */
#if !defined(_MAX_PATH) && (defined(MSWIN32) || defined(MSWINCE) \
return(result);
}
-STATIC GC_abort_func abort_fn = NULL; /* JCB */
+STATIC GC_abort_func abort_fn = NULL;
GC_API void GC_CALL GC_set_abort_func(GC_abort_func fn)
{