diff options
Diffstat (limited to 'nsprpub/pr/include/md/_pth.h')
-rw-r--r-- | nsprpub/pr/include/md/_pth.h | 67 |
1 files changed, 23 insertions, 44 deletions
diff --git a/nsprpub/pr/include/md/_pth.h b/nsprpub/pr/include/md/_pth.h index 5603223a0..37d26e700 100644 --- a/nsprpub/pr/include/md/_pth.h +++ b/nsprpub/pr/include/md/_pth.h @@ -84,23 +84,23 @@ * PR_EnterMonitor calls any of these functions, infinite * recursion ensues. */ -#if defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \ - || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \ - || defined(HPUX) || defined(FREEBSD) \ - || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \ - || defined(NTO) || defined(DARWIN) \ - || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN) +#if defined(AIX) || defined(SOLARIS) \ + || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \ + || defined(HPUX) || defined(FREEBSD) \ + || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \ + || defined(NTO) || defined(DARWIN) \ + || defined(UNIXWARE) || defined(RISCOS) #define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t) (t) = 0 #define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t) (t) == 0 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st) -#else +#else #error "pthreads is not supported for this architecture" #endif #if defined(_PR_PTHREADS) #define _PT_PTHREAD_ATTR_INIT pthread_attr_init #define _PT_PTHREAD_ATTR_DESTROY pthread_attr_destroy -#define _PT_PTHREAD_CREATE(t, a, f, r) pthread_create(t, &a, f, r) +#define _PT_PTHREAD_CREATE(t, a, f, r) pthread_create(t, &a, f, r) #define _PT_PTHREAD_KEY_CREATE pthread_key_create #define _PT_PTHREAD_ATTR_SETSCHEDPOLICY pthread_attr_setschedpolicy #define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) pthread_attr_getstacksize(a, s) @@ -113,21 +113,14 @@ * These platforms don't have sigtimedwait() */ #if (defined(AIX) && !defined(AIX4_3_PLUS)) \ - || defined(LINUX) || defined(__GNU__)|| defined(__GLIBC__) \ - || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ - || defined(BSDI) || defined(UNIXWARE) \ - || defined(DARWIN) || defined(SYMBIAN) + || defined(LINUX) || defined(__GNU__)|| defined(__GLIBC__) \ + || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ + || defined(BSDI) || defined(UNIXWARE) \ + || defined(DARWIN) #define PT_NO_SIGTIMEDWAIT #endif -#if defined(OSF1) -#define PT_PRIO_MIN PRI_OTHER_MIN -#define PT_PRIO_MAX PRI_OTHER_MAX -#elif defined(IRIX) -#include <sys/sched.h> -#define PT_PRIO_MIN PX_PRIO_MIN -#define PT_PRIO_MAX PX_PRIO_MAX -#elif defined(AIX) +#if defined(AIX) #include <sys/priv.h> #include <sys/sched.h> #ifndef PTHREAD_CREATE_JOINABLE @@ -140,7 +133,7 @@ #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER) #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER) #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \ - || defined(FREEBSD) || defined(SYMBIAN) + || defined(FREEBSD) #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER) #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER) #elif defined(NTO) @@ -164,8 +157,8 @@ #define PT_PRIO_MIN 0 #define PT_PRIO_MAX 31 #elif defined(NETBSD) \ - || defined(BSDI) || defined(DARWIN) || defined(UNIXWARE) \ - || defined(RISCOS) /* XXX */ + || defined(BSDI) || defined(DARWIN) || defined(UNIXWARE) \ + || defined(RISCOS) /* XXX */ #define PT_PRIO_MIN 0 #define PT_PRIO_MAX 126 #else @@ -177,29 +170,15 @@ * Needed for garbage collection -- Look at PR_Suspend/PR_Resume * implementation. */ -#if defined(OSF1) -/* - * sched_yield can't be called from a signal handler. Must use - * the _np version. - */ -#define _PT_PTHREAD_YIELD() pthread_yield_np() -#elif defined(AIX) +#if defined(AIX) extern int (*_PT_aix_yield_fcn)(); -#define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)() -#elif defined(IRIX) -#include <time.h> -#define _PT_PTHREAD_YIELD() \ - PR_BEGIN_MACRO \ - struct timespec onemillisec = {0}; \ - onemillisec.tv_nsec = 1000000L; \ - nanosleep(&onemillisec,NULL); \ - PR_END_MACRO +#define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)() #elif defined(HPUX) || defined(SOLARIS) \ - || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \ - || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ - || defined(BSDI) || defined(NTO) || defined(DARWIN) \ - || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN) -#define _PT_PTHREAD_YIELD() sched_yield() + || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \ + || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ + || defined(BSDI) || defined(NTO) || defined(DARWIN) \ + || defined(UNIXWARE) || defined(RISCOS) +#define _PT_PTHREAD_YIELD() sched_yield() #else #error "Need to define _PT_PTHREAD_YIELD for this platform" #endif |