+2007-02-01 Geoff Norton <gnorton@customerdna.com>
+
+ * include/private/gc_pthread_redirects.h:
+ * include/private/gc_config_macros.h:
+ * include/private/gc_priv.h:
+ * configure.in:
+ * pthread_support.c
+ * specific.c: Support for NetBSD-CURRENT. Loosely based on NetBSD
+ pkgsrc patch.
+
2006-12-22 Robert Jordan <robertj@gmx.net>
* include/private/gcconfig.h, os_dep.c:
AC_DEFINE(PARALLEL_MARK)
fi
;;
+ *-*-netbsd*)
+ AC_DEFINE(GC_NETBSD_THREADS)
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
+ fi
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ ;;
*-*-osf*)
AC_DEFINE(GC_OSF1_THREADS)
if test "${enable_parallel_mark}" = yes; then
defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
- defined(GC_AIX_THREADS) || \
+ defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
# define GC_PTHREADS
# endif
# define pthread_join GC_pthread_join
# define pthread_detach GC_pthread_detach
-#ifndef GC_DARWIN_THREADS
+#ifndef GC_DARWIN_THREADS
+# ifdef GC_NETBSD_THREADS
+# undef pthread_sigmask
+# endif
# define pthread_sigmask GC_pthread_sigmask
# define dlopen GC_dlopen
#endif
/* in Linux glibc, but it's not exported.) Thus we continue to use */
/* the same hard-coded signals we've always used. */
# if !defined(SIG_SUSPEND)
-# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
+# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS) || defined(GC_NETBSD_THREADS)
# if defined(SPARC) && !defined(SIGPWR)
/* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
* It is aliased to SIGLOST in asm/signal.h, though. */
# endif
# if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
- defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \
- && !defined(USE_PTHREAD_SPECIFIC)
+ defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) || \
+ defined(GC_NETBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC)
# define USE_PTHREAD_SPECIFIC
# endif
# include <sys/sysctl.h>
#endif /* GC_DARWIN_THREADS */
+#if defined(GC_NETBSD_THREADS)
+# include <sys/param.h>
+# include <sys/sysctl.h>
+#endif
+
#if defined(GC_DGUX386_THREADS)
GC_nprocs = sysconf(_SC_NPROC_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# endif
-# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS)
+# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) || defined(GC_NETBSD_THREADS)
int ncpus = 1;
size_t len = sizeof(ncpus);
sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
#include "private/gc_priv.h" /* For GC_compare_and_exchange, GC_memory_barrier */
-#if defined(GC_LINUX_THREADS)
+#if defined(GC_LINUX_THREADS) || defined(GC_NETBSD_THREADS)
#include "private/specific.h"