$NetBSD: patch-ak,v 1.10 2013/05/29 11:11:12 wiz Exp $ --- libgc/pthread_support.c.orig 2012-12-05 17:44:36.000000000 +0000 +++ libgc/pthread_support.c @@ -71,7 +71,7 @@ defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) || \ defined(GC_NETBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC) || \ defined(GC_FREEBSD_THREADS) && !defined(USE_PTHREAD_SPECIFIC) || \ - defined(GC_OPENBSD_THREADS) + !defined(USE_COMPILER_TLS) || defined(GC_OPENBSD_THREADS) # define USE_PTHREAD_SPECIFIC # endif #endif @@ -1280,6 +1280,22 @@ void GC_end_blocking(void) { #define __d10_sleep sleep #endif /* GC_DGUX386_THREADS */ +#undef nanosleep +#undef usleep +#undef sleep + +/* A wrapper for the standard C nanosleep function */ +int WRAP_FUNC(nanosleep) (const struct timespec *rqtp, struct timespec *rmtp) +{ + int result; + + GC_start_blocking(); + result = REAL_FUNC(nanosleep)(rqtp, rmtp); + GC_end_blocking(); + + return result; +} + /* A wrapper for the standard C sleep function */ int WRAP_FUNC(sleep) (unsigned int seconds) {