Bug 1420407, Land NSPR 4.18 into FF 59, NSPR_4_18_BETA5, r=me
authorKai Engert <kaie@kuix.de>
Thu, 21 Dec 2017 14:58:24 +0100
changeset 397213 3a9a20dfd7b3bbac4b58eae2438d91410d34e572
parent 397212 9fc50694c8f7324e7cb4a4c7817761c51610204c
child 397214 3bdd7743f057a0b8242a615cddb1fd35639aa223
push id33128
push useraiakab@mozilla.com
push dateThu, 21 Dec 2017 22:20:14 +0000
treeherdermozilla-central@f844e99f26b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1420407
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1420407, Land NSPR 4.18 into FF 59, NSPR_4_18_BETA5, r=me UPGRADE_NSPR_RELEASE
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/md/_pth.h
nsprpub/pr/include/private/primpl.h
nsprpub/pr/src/Makefile.in
nsprpub/pr/src/md/unix/unix.c
nsprpub/pr/src/md/unix/uxproces.c
nsprpub/pr/src/misc/pratom.c
nsprpub/pr/src/pthreads/ptio.c
nsprpub/pr/src/pthreads/ptsynch.c
nsprpub/pr/src/pthreads/ptthread.c
nsprpub/pr/src/threads/prrwlock.c
nsprpub/pr/tests/Makefile.in
nsprpub/pr/tests/attach.c
nsprpub/pr/tests/dceemu.c
nsprpub/pr/tests/foreign.c
nsprpub/pr/tests/forktest.c
nsprpub/pr/tests/provider.c
nsprpub/pr/tests/socket.c
nsprpub/pr/tests/testfile.c
nsprpub/pr/tests/thrpool_client.c
nsprpub/pr/tests/thrpool_server.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_18_BETA4
+NSPR_4_18_BETA5
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,9 +5,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -6555,21 +6555,23 @@ fi
     $as_echo "#define DARWIN 1" >>confdefs.h
 
     $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
 
     $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
 
     $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
 
+
     HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
+
     if test "$HOST_DARWIN_MAJOR" -ge 15 ; then
         $as_echo "#define HAS_CONNECTX 1" >>confdefs.h
-    fi
-
+
+    fi
     AS='$(CC) -x assembler-with-cpp'
     CFLAGS="$CFLAGS -Wall -fno-common"
     case "${target_cpu}" in
         arm*)
             CPU_ARCH=arm
             ;;
         i*86*|x86_64)
             if test -n "$USE_64"; then
@@ -8467,29 +8469,22 @@ case "$target" in
     fi
     ;;
 *-hpux*)
     if test -n "$USE_NSPR_THREADS"; then
         $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
 
     fi
     if test "$USE_PTHREADS"; then
-        if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
-            $as_echo "#define _REENTRANT 1" >>confdefs.h
-
-            $as_echo "#define _PR_DCETHREADS 1" >>confdefs.h
-
-        else
-            cat >>confdefs.h <<_ACEOF
+        cat >>confdefs.h <<_ACEOF
 #define _POSIX_C_SOURCE 199506L
 _ACEOF
 
-            $as_echo "#define _PR_HAVE_THREADSAFE_GETHOST 1" >>confdefs.h
-
-        fi
+        $as_echo "#define _PR_HAVE_THREADSAFE_GETHOST 1" >>confdefs.h
+
     fi
     if test "$USE_USER_PTHREADS"; then
         cat >>confdefs.h <<_ACEOF
 #define _POSIX_C_SOURCE 199506L
 _ACEOF
 
     fi
     ;;
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -2884,23 +2884,18 @@ case "$target" in
         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi
     ;;
 *-hpux*)
     if test -n "$USE_NSPR_THREADS"; then
         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi 
     if test "$USE_PTHREADS"; then
-        if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
-            AC_DEFINE(_REENTRANT)
-            AC_DEFINE(_PR_DCETHREADS)
-        else
-            AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
-            AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
-        fi
+        AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
+        AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
     fi
     if test "$USE_USER_PTHREADS"; then
         AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
     fi
     ;;
 *-irix*)
     if test "${target_os}" = "irix6.5"; then
         if test -n "$USE_PTHREADS"; then
--- a/nsprpub/pr/include/md/_pth.h
+++ b/nsprpub/pr/include/md/_pth.h
@@ -9,39 +9,17 @@
 /*
 ** Appropriate definitions of entry points not used in a pthreads world
 */
 #define _PR_MD_BLOCK_CLOCK_INTERRUPTS()
 #define _PR_MD_UNBLOCK_CLOCK_INTERRUPTS()
 #define _PR_MD_DISABLE_CLOCK_INTERRUPTS()
 #define _PR_MD_ENABLE_CLOCK_INTERRUPTS()
 
-/* In good standards fashion, the DCE threads (based on posix-4) are not
- * quite the same as newer posix implementations.  These are mostly name
- * changes and small differences, so macros usually do the trick
- */
-#ifdef _PR_DCETHREADS
-#define _PT_PTHREAD_MUTEXATTR_INIT        pthread_mutexattr_create
-#define _PT_PTHREAD_MUTEXATTR_DESTROY     pthread_mutexattr_delete
-#define _PT_PTHREAD_MUTEX_INIT(m, a)      pthread_mutex_init(&(m), a)
-#define _PT_PTHREAD_MUTEX_IS_LOCKED(m)    (0 == pthread_mutex_trylock(&(m)))
-#define _PT_PTHREAD_CONDATTR_INIT         pthread_condattr_create
-#define _PT_PTHREAD_COND_INIT(m, a)       pthread_cond_init(&(m), a)
-#define _PT_PTHREAD_CONDATTR_DESTROY      pthread_condattr_delete
-
-/* Notes about differences between DCE threads and pthreads 10:
- *   1. pthread_mutex_trylock returns 1 when it locks the mutex
- *      0 when it does not.  The latest pthreads has a set of errno-like
- *      return values.
- *   2. return values from pthread_cond_timedwait are different.
- *
- *
- *
- */
-#elif defined(BSDI)
+#if defined(BSDI)
 /*
  * Mutex and condition attributes are not supported.  The attr
  * argument to pthread_mutex_init() and pthread_cond_init() must
  * be passed as NULL.
  *
  * The memset calls in _PT_PTHREAD_MUTEX_INIT and _PT_PTHREAD_COND_INIT
  * are to work around BSDI's using a single bit to indicate a mutex
  * or condition variable is initialized.  This entire BSDI section
@@ -101,73 +79,41 @@
  *   (one should be able to read a pointer with a single machine
  *   instruction).  However, PR_GetCurrentThread calls calloc if
  *   it is called by a thread that was not created by NSPR.  The
  *   malloc tracing tools in the Mozilla client use PRMonitor for
  *   locking in their malloc, calloc, and free functions.  If
  *   PR_EnterMonitor calls any of these functions, infinite
  *   recursion ensues.
  */
-#if defined(_PR_DCETHREADS)
-#define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t) \
-	memset(&(t), 0, sizeof(pthread_t))
-#define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t) \
-	(!memcmp(&(t), &pt_zero_tid, sizeof(pthread_t)))
-#define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
-#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
+#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)
 #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 
 #error "pthreads is not supported for this architecture"
 #endif
 
-#if defined(_PR_DCETHREADS)
-#define _PT_PTHREAD_ATTR_INIT            pthread_attr_create
-#define _PT_PTHREAD_ATTR_DESTROY         pthread_attr_delete
-#define _PT_PTHREAD_CREATE(t, a, f, r)   pthread_create(t, a, f, r) 
-#define _PT_PTHREAD_KEY_CREATE           pthread_keycreate
-#define _PT_PTHREAD_ATTR_SETSCHEDPOLICY  pthread_attr_setsched
-#define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) \
-                                     (*(s) = pthread_attr_getstacksize(*(a)), 0)
-#define _PT_PTHREAD_GETSPECIFIC(k, r) \
-		pthread_getspecific((k), (pthread_addr_t *) &(r))
-#elif defined(_PR_PTHREADS)
+#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_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)
 #define _PT_PTHREAD_GETSPECIFIC(k, r)    (r) = pthread_getspecific(k)
 #else
 #error "Cannot determine pthread strategy"
 #endif
 
-#if defined(_PR_DCETHREADS)
-#define _PT_PTHREAD_EXPLICIT_SCHED      _PT_PTHREAD_DEFAULT_SCHED
-#endif
-
-/*
- * pthread_mutex_trylock returns different values in DCE threads and
- * pthreads.
- */
-#if defined(_PR_DCETHREADS)
-#define PT_TRYLOCK_SUCCESS 1
-#define PT_TRYLOCK_BUSY    0
-#else
-#define PT_TRYLOCK_SUCCESS 0
-#define PT_TRYLOCK_BUSY    EBUSY
-#endif
-
 /*
  * 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)
@@ -185,26 +131,19 @@
 #include <sys/priv.h>
 #include <sys/sched.h>
 #ifndef PTHREAD_CREATE_JOINABLE
 #define PTHREAD_CREATE_JOINABLE     PTHREAD_CREATE_UNDETACHED
 #endif
 #define PT_PRIO_MIN            DEFAULT_PRIO
 #define PT_PRIO_MAX            DEFAULT_PRIO
 #elif defined(HPUX)
-
-#if defined(_PR_DCETHREADS)
-#define PT_PRIO_MIN            PRI_OTHER_MIN
-#define PT_PRIO_MAX            PRI_OTHER_MAX
-#else /* defined(_PR_DCETHREADS) */
 #include <sys/sched.h>
 #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
 #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
-#endif /* defined(_PR_DCETHREADS) */
-
 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
 	|| defined(FREEBSD) || defined(SYMBIAN)
 #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
 #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
 #elif defined(NTO)
 /*
  * Neutrino has functions that return the priority range but
  * they return invalid numbers, so I just hard coded these here
@@ -233,19 +172,17 @@
 #error "pthreads is not supported for this architecture"
 #endif
 
 /*
  * The _PT_PTHREAD_YIELD function is called from a signal handler.
  * Needed for garbage collection -- Look at PR_Suspend/PR_Resume
  * implementation.
  */
-#if defined(_PR_DCETHREADS)
-#define _PT_PTHREAD_YIELD()            	pthread_yield()
-#elif defined(OSF1)
+#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)
 extern int (*_PT_aix_yield_fcn)();
 #define _PT_PTHREAD_YIELD()			(*_PT_aix_yield_fcn)()
--- a/nsprpub/pr/include/private/primpl.h
+++ b/nsprpub/pr/include/private/primpl.h
@@ -1,24 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef primpl_h___
 #define primpl_h___
 
-/*
- * HP-UX 10.10's pthread.h (DCE threads) includes dce/cma.h, which
- * has:
- *     #define sigaction _sigaction_sys
- * This macro causes chaos if signal.h gets included before pthread.h.
- * To be safe, we include pthread.h first.
- */
-
 #if defined(_PR_PTHREADS)
 #include <pthread.h>
 #endif
 
 #if defined(_PR_BTHREADS)
 #include <kernel/OS.h>
 #endif
 
@@ -1872,17 +1864,17 @@ extern PRFileDesc *_pr_stderr;
 /* Zone allocator */
 /*
 ** The zone allocator code has hardcoded pthread types and
 ** functions, so it can only be used in the pthreads version.
 ** This can be fixed by replacing the hardcoded pthread types
 ** and functions with macros that expand to the native thread
 ** types and functions on each platform.
 */
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #define _PR_ZONE_ALLOCATOR
 #endif
 
 #ifdef _PR_ZONE_ALLOCATOR
 extern void _PR_InitZones(void);
 extern void _PR_DestroyZones(void);
 #endif
 
--- a/nsprpub/pr/src/Makefile.in
+++ b/nsprpub/pr/src/Makefile.in
@@ -133,22 +133,18 @@ endif
 ifneq ($(OS_TARGET),Android)
 # Android has no librt - realtime functions are in libc
 OS_LIBS		+= -lrt
 endif
 endif
 
 ifeq ($(OS_ARCH),HP-UX)
 ifeq ($(USE_PTHREADS), 1)
-ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
-OS_LIBS 	= -ldce
-else
 OS_LIBS 	= -lpthread -lrt
 endif
-endif
 ifeq ($(PTHREADS_USER), 1)
 OS_LIBS 	= -lpthread
 endif
 ifeq ($(basename $(OS_RELEASE)),A.09)
 OS_LIBS		+= -ldld -L/lib/pa1.1 -lm
 else
 OS_LIBS		+= -ldld -lm -lc
 endif
--- a/nsprpub/pr/src/md/unix/unix.c
+++ b/nsprpub/pr/src/md/unix/unix.c
@@ -2849,38 +2849,21 @@ void _PR_UnixInit(void)
         sigact.sa_flags = 0;
         sigact.sa_mask = timer_set;
         sigaction(SIGBUS, &sigact, 0);
     }
 
 #endif
 #endif  /* !defined(_PR_PTHREADS) */
 
-    /*
-     * Under HP-UX DCE threads, sigaction() installs a per-thread
-     * handler, so we use sigvector() to install a process-wide
-     * handler.
-     */
-#if defined(HPUX) && defined(_PR_DCETHREADS)
-    {
-        struct sigvec vec;
-
-        vec.sv_handler = SIG_IGN;
-        vec.sv_mask = 0;
-        vec.sv_flags = 0;
-        rv = sigvector(SIGPIPE, &vec, NULL);
-        PR_ASSERT(0 == rv);
-    }
-#else
     sigact.sa_handler = SIG_IGN;
     sigemptyset(&sigact.sa_mask);
     sigact.sa_flags = 0;
     rv = sigaction(SIGPIPE, &sigact, 0);
     PR_ASSERT(0 == rv);
-#endif /* HPUX && _PR_DCETHREADS */
 
     _pr_rename_lock = PR_NewLock();
     PR_ASSERT(NULL != _pr_rename_lock);
     _pr_Xfe_mon = PR_NewMonitor();
     PR_ASSERT(NULL != _pr_Xfe_mon);
 
     _PR_InitIOV();  /* one last hack */
 }
--- a/nsprpub/pr/src/md/unix/uxproces.c
+++ b/nsprpub/pr/src/md/unix/uxproces.c
@@ -680,20 +680,16 @@ static void pr_SigchldHandler(int sig)
     }
 #endif
 
     errno = errnoCopy;
 }
 
 static void pr_InstallSigchldHandler()
 {
-#if defined(HPUX) && defined(_PR_DCETHREADS)
-#error "HP-UX DCE threads have their own SIGCHLD handler"
-#endif
-
     struct sigaction act, oact;
     int rv;
 
     act.sa_handler = pr_SigchldHandler;
     sigemptyset(&act.sa_mask);
     act.sa_flags = SA_NOCLDSTOP | SA_RESTART;
     rv = sigaction(SIGCHLD, &act, &oact);
     PR_ASSERT(0 == rv);
--- a/nsprpub/pr/src/misc/pratom.c
+++ b/nsprpub/pr/src/misc/pratom.c
@@ -18,17 +18,17 @@
  * atomic operations for platforms without atomic operations.
  * If a platform has atomic operations, it should define the
  * macro _PR_HAVE_ATOMIC_OPS, and the following will not be
  * compiled in.
  */
 
 #if !defined(_PR_HAVE_ATOMIC_OPS)
 
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 /*
  * PR_AtomicDecrement() is used in NSPR's thread-specific data
  * destructor.  Because thread-specific data destructors may be
  * invoked after a PR_Cleanup() call, we need an implementation
  * of the atomic routines that doesn't need NSPR to be initialized.
  */
 
 /*
@@ -185,17 +185,17 @@ PRInt32
     rv = *val;
     *val = newval;
 #ifdef DEBUG
     hash_lock_counts[idx]++;
 #endif
     pthread_mutex_unlock(&atomic_locks[idx]);
     return rv;
 }
-#else  /* _PR_PTHREADS && !_PR_DCETHREADS */
+#else  /* _PR_PTHREADS */
 /*
  * We use a single lock for all the emulated atomic operations.
  * The lock contention should be acceptable.
  */
 static PRLock *atomic_lock = NULL;
 void _PR_MD_INIT_ATOMIC(void)
 {
     if (atomic_lock == NULL) {
@@ -254,17 +254,17 @@ PRInt32
         _PR_ImplicitInitialization();
     }
     PR_Lock(atomic_lock);
     rv = *val;
     *val = newval;
     PR_Unlock(atomic_lock);
     return rv;
 }
-#endif  /* _PR_PTHREADS && !_PR_DCETHREADS */
+#endif  /* _PR_PTHREADS */
 
 #endif  /* !_PR_HAVE_ATOMIC_OPS */
 
 void _PR_InitAtomic(void)
 {
     _PR_MD_INIT_ATOMIC();
 }
 
--- a/nsprpub/pr/src/pthreads/ptio.c
+++ b/nsprpub/pr/src/pthreads/ptio.c
@@ -1890,42 +1890,29 @@ static PRInt32 pt_Send(
     PRIntn flags, PRIntervalTime timeout)
 {
     PRInt32 syserrno, bytes = -1;
     PRBool fNeedContinue = PR_FALSE;
 #if defined(SOLARIS)
 	PRInt32 tmp_amount = amount;
 #endif
 
-    /*
-     * Under HP-UX DCE threads, pthread.h includes dce/cma_ux.h,
-     * which has the following:
-     *     #  define send        cma_send
-     *     extern int  cma_send (int , void *, int, int );
-     * So we need to cast away the 'const' of argument #2 for send().
-     */
-#if defined (HPUX) && defined(_PR_DCETHREADS)
-#define PT_SENDBUF_CAST (void *)
-#else
-#define PT_SENDBUF_CAST
-#endif
-
     if (pt_TestAbort()) return bytes;
 
     /*
      * On pre-2.6 Solaris, send() is much slower than write().
      * On 2.6 and beyond, with in-kernel sockets, send() and
      * write() are fairly equivalent in performance.
      */
 #if defined(SOLARIS)
     PR_ASSERT(0 == flags);
 retry:
-    bytes = write(fd->secret->md.osfd, PT_SENDBUF_CAST buf, tmp_amount);
+    bytes = write(fd->secret->md.osfd, buf, tmp_amount);
 #else
-    bytes = send(fd->secret->md.osfd, PT_SENDBUF_CAST buf, amount, flags);
+    bytes = send(fd->secret->md.osfd, buf, amount, flags);
 #endif
     syserrno = errno;
 
 #if defined(SOLARIS)
     /*
      * The write system call has been reported to return the ERANGE error
      * on occasion. Try to write in smaller chunks to workaround this bug.
      */
--- a/nsprpub/pr/src/pthreads/ptsynch.c
+++ b/nsprpub/pr/src/pthreads/ptsynch.c
@@ -18,21 +18,16 @@
 #include <pthread.h>
 #include <sys/time.h>
 
 static pthread_mutexattr_t _pt_mattr;
 static pthread_condattr_t _pt_cvar_attr;
 
 #if defined(DEBUG)
 extern PTDebug pt_debug;  /* this is shared between several modules */
-
-#if defined(_PR_DCETHREADS)
-static pthread_t pt_zero_tid;  /* a null pthread_t (pthread_t is a struct
-                                * in DCE threads) to compare with */
-#endif  /* defined(_PR_DCETHREADS) */
 #endif  /* defined(DEBUG) */
 
 #if defined(FREEBSD)
 /*
  * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
  * Newer versions return EBUSY.  We still need to support both.
  */
 static int
@@ -258,22 +253,17 @@ static PRIntn pt_TimedWait(
     tmo.tv_sec += now.tv_sec;
     tmo.tv_nsec += (PT_NANOPERMICRO * now.tv_usec);
     tmo.tv_sec += tmo.tv_nsec / PT_BILLION;
     tmo.tv_nsec %= PT_BILLION;
 
     rv = pthread_cond_timedwait(cv, ml, &tmo);
 
     /* NSPR doesn't report timeouts */
-#ifdef _PR_DCETHREADS
-    if (rv == -1) return (errno == EAGAIN) ? 0 : errno;
-    else return rv;
-#else
     return (rv == ETIMEDOUT) ? 0 : rv;
-#endif
 }  /* pt_TimedWait */
 
 
 /*
  * Notifies just get posted to the protecting mutex. The
  * actual notification is done when the lock is released so that
  * MP systems don't contend for a lock that they can't have.
  */
@@ -1166,24 +1156,24 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
 /**************************************************************/
 /**************************************************************/
 
 #include "prpdce.h"
 
 PR_IMPLEMENT(PRStatus) PRP_TryLock(PRLock *lock)
 {
     PRIntn rv = pthread_mutex_trylock(&lock->mutex);
-    if (rv == PT_TRYLOCK_SUCCESS)
+    if (rv == 0)
     {
         PR_ASSERT(PR_FALSE == lock->locked);
         lock->locked = PR_TRUE;
         lock->owner = pthread_self();
     }
     /* XXX set error code? */
-    return (PT_TRYLOCK_SUCCESS == rv) ? PR_SUCCESS : PR_FAILURE;
+    return (0 == rv) ? PR_SUCCESS : PR_FAILURE;
 }  /* PRP_TryLock */
 
 PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCondVar(void)
 {
     PRCondVar *cv;
 
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
--- a/nsprpub/pr/src/pthreads/ptthread.c
+++ b/nsprpub/pr/src/pthreads/ptthread.c
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
 ** File:            ptthread.c
 ** Descritpion:        Implemenation for threds using pthreds
 ** Exports:            ptthread.h
 */
 
-#if defined(_PR_PTHREADS) || defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 
 #include "prlog.h"
 #include "primpl.h"
 #include "prpdce.h"
 
 #include <pthread.h>
 #include <unistd.h>
 #include <string.h>
@@ -53,26 +53,26 @@ static struct _PT_Bookeeping
 {
     PRLock *ml;                 /* a lock to protect ourselves */
     PRCondVar *cv;              /* used to signal global things */
     PRInt32 system, user;       /* a count of the two different types */
     PRUintn this_many;          /* number of threads allowed for exit */
     pthread_key_t key;          /* thread private data key */
     PRBool keyCreated;          /* whether 'key' should be deleted */
     PRThread *first, *last;     /* list of threads we know about */
-#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
     PRInt32 minPrio, maxPrio;   /* range of scheduling priorities */
 #endif
 } pt_book = {0};
 
 static void _pt_thread_death(void *arg);
 static void _pt_thread_death_internal(void *arg, PRBool callDestructors);
 static void init_pthread_gc_support(void);
 
-#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
 static PRIntn pt_PriorityMap(PRThreadPriority pri)
 {
 #ifdef NTO
     /* This priority algorithm causes lots of problems on Neutrino
      * for now I have just hard coded everything to run at priority 10
      * until I can come up with a new algorithm.
      *     Jerry.Kirk@Nexwarecorp.com
      */
@@ -143,31 +143,16 @@ static void *_pt_root(void *arg)
     /* If we cannot read the main thread's nice value don't try to change the
      * new thread's nice value. */
     if (errno == 0) {
         setpriority(PRIO_PROCESS, tid,
                     pt_RelativePriority(rv, thred->priority));
     }
 #endif
 
-    /*
-    ** DCE Threads can't detach during creation, so do it late.
-    ** I would like to do it only here, but that doesn't seem
-    ** to work.
-    */
-#if defined(_PR_DCETHREADS)
-    if (detached)
-    {
-        /* pthread_detach() modifies its argument, so we must pass a copy */
-        pthread_t self = id;
-        rv = pthread_detach(&self);
-        PR_ASSERT(0 == rv);
-    }
-#endif /* defined(_PR_DCETHREADS) */
-
     /* Set up the thread stack information */
     _PR_InitializeStack(thred->stack);
 
     /*
      * Set within the current thread the pointer to our object.
      * This object will be deleted when the thread termintates,
      * whether in a join or detached (see _PR_InitThreads()).
      */
@@ -324,53 +309,44 @@ static PRThread* _PR_CreateThread(
     else if ((PRIntn)PR_PRIORITY_LAST < (PRIntn)priority)
         priority = PR_PRIORITY_LAST;
 
     rv = _PT_PTHREAD_ATTR_INIT(&tattr);
     PR_ASSERT(0 == rv);
 
     if (EPERM != pt_schedpriv)
     {
-#if !defined(_PR_DCETHREADS) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
         struct sched_param schedule;
 #endif
 
 #if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
         rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED);
         PR_ASSERT(0 == rv);
 #endif
 
         /* Use the default scheduling policy */
 
-#if defined(_PR_DCETHREADS)
-        rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority));
-        PR_ASSERT(0 == rv);
-#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
         rv = pthread_attr_getschedparam(&tattr, &schedule);
         PR_ASSERT(0 == rv);
         schedule.sched_priority = pt_PriorityMap(priority);
         rv = pthread_attr_setschedparam(&tattr, &schedule);
         PR_ASSERT(0 == rv);
 #ifdef NTO
         rv = pthread_attr_setschedpolicy(&tattr, SCHED_RR); /* Round Robin */
         PR_ASSERT(0 == rv);
 #endif
-#endif /* !defined(_PR_DCETHREADS) */
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING > 0 */
     }
 
-    /*
-     * DCE threads can't set detach state before creating the thread.
-     * AIX can't set detach late. Why can't we all just get along?
-     */
-#if !defined(_PR_DCETHREADS)
     rv = pthread_attr_setdetachstate(&tattr,
         ((PR_JOINABLE_THREAD == state) ?
             PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED));
     PR_ASSERT(0 == rv);
-#endif /* !defined(_PR_DCETHREADS) */
 
     /*
      * If stackSize is 0, we use the default pthread stack size.
      */
     if (stackSize)
     {
 #ifdef _MD_MINIMUM_STACK_SIZE
         if (stackSize < _MD_MINIMUM_STACK_SIZE)
@@ -451,17 +427,16 @@ static PRThread* _PR_CreateThread(
 
         /*
          * We pass a pointer to a local copy (instead of thred->id)
          * to pthread_create() because who knows what wacky things
          * pthread_create() may be doing to its argument.
          */
         rv = _PT_PTHREAD_CREATE(&id, tattr, _pt_root, thred);
 
-#if !defined(_PR_DCETHREADS)
         if (EPERM == rv)
         {
 #if defined(IRIX)
         	if (PR_GLOBAL_BOUND_THREAD == scope) {
 				/*
 				 * SCOPE_SYSTEM requires appropriate privilege
 				 * reset to process scope and try again
 				 */
@@ -477,25 +452,20 @@ static PRThread* _PR_CreateThread(
             /* Try creating the thread again without setting priority. */
 #if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
             rv = pthread_attr_setinheritsched(&tattr, PTHREAD_INHERIT_SCHED);
             PR_ASSERT(0 == rv);
 #endif
 #endif	/* IRIX */
             rv = _PT_PTHREAD_CREATE(&id, tattr, _pt_root, thred);
         }
-#endif
 
         if (0 != rv)
         {
-#if defined(_PR_DCETHREADS)
-            PRIntn oserr = errno;
-#else
             PRIntn oserr = rv;
-#endif
             PR_Lock(pt_book.ml);
             if (thred->state & PT_THREAD_SYSTEM)
                 pt_book.system -= 1;
             else if (--pt_book.user == pt_book.this_many)
                 PR_NotifyAllCondVar(pt_book.cv);
             PR_Unlock(pt_book.ml);
 
             PR_Free(thred->stack);
@@ -597,20 +567,16 @@ PR_IMPLEMENT(PRStatus) PR_JoinThread(PRT
     }
     else
     {
         pthread_t id = thred->id;
         rv = pthread_join(id, &result);
         PR_ASSERT(rv == 0 && result == NULL);
         if (0 == rv)
         {
-#ifdef _PR_DCETHREADS
-            rv = pthread_detach(&id);
-            PR_ASSERT(0 == rv);
-#endif
             /*
              * PR_FALSE, because the thread already called the TPD
              * destructors before exiting _pt_root.
              */
             _pt_thread_death_internal(thred, PR_FALSE);
         }
         else
         {
@@ -688,20 +654,17 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(
 
     PR_ASSERT(NULL != thred);
 
     if ((PRIntn)PR_PRIORITY_FIRST > (PRIntn)newPri)
         newPri = PR_PRIORITY_FIRST;
     else if ((PRIntn)PR_PRIORITY_LAST < (PRIntn)newPri)
         newPri = PR_PRIORITY_LAST;
 
-#if defined(_PR_DCETHREADS)
-    rv = pthread_setprio(thred->id, pt_PriorityMap(newPri));
-    /* pthread_setprio returns the old priority */
-#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
     if (EPERM != pt_schedpriv)
     {
         int policy;
         struct sched_param schedule;
 
         rv = pthread_getschedparam(thred->id, &policy, &schedule);
         if(0 == rv) {
 			schedule.sched_priority = pt_PriorityMap(newPri);
@@ -922,17 +885,17 @@ void _PR_InitThreads(
      * initialized, but pthread_self() fails to initialize
      * pthreads and hence returns a null thread ID if invoked
      * by the primordial thread before any other pthread call.
      * So we explicitly initialize pthreads here.
      */
     pthread_init();
 #endif
 
-#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
 #if defined(FREEBSD)
     {
     pthread_attr_t attr;
     int policy;
     /* get the min and max priorities of the default policy */
     pthread_attr_init(&attr);
     pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
     pthread_attr_getschedpolicy(&attr, &policy);
@@ -1156,21 +1119,17 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
 
 PR_IMPLEMENT(void) PR_ProcessExit(PRIntn status)
 {
     _exit(status);
 }
 
 PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
 {
-#if defined(_PR_DCETHREADS)
-    return (PRUint32)&thred->id;  /* this is really a sham! */
-#else
     return (PRUint32)thred->id;  /* and I don't know what they will do with it */
-#endif
 }
 
 /*
  * $$$
  * The following two thread-to-processor affinity functions are not
  * yet implemented for pthreads.  By the way, these functions should return
  * PRStatus rather than PRInt32 to indicate the success/failure status.
  * $$$
@@ -1192,61 +1151,41 @@ PR_SetThreadDumpProc(PRThread* thread, P
     thread->dump = dump;
     thread->dumpArg = arg;
 }
 
 /* 
  * Garbage collection support follows.
  */
 
-#if defined(_PR_DCETHREADS)
-
-/*
- * statics for Garbage Collection support.  We don't need to protect these
- * signal masks since the garbage collector itself is protected by a lock
- * and multiple threads will not be garbage collecting at the same time.
- */
-static sigset_t javagc_vtalarm_sigmask;
-static sigset_t javagc_intsoff_sigmask;
-
-#else /* defined(_PR_DCETHREADS) */
-
 /* a bogus signal mask for forcing a timed wait */
 /* Not so bogus in AIX as we really do a sigwait */
 static sigset_t sigwait_set;
 
 static struct timespec onemillisec = {0, 1000000L};
 #ifndef PT_NO_SIGTIMEDWAIT
 static struct timespec hundredmillisec = {0, 100000000L};
 #endif
 
 static void suspend_signal_handler(PRIntn sig);
 
 #ifdef PT_NO_SIGTIMEDWAIT
 static void null_signal_handler(PRIntn sig);
 #endif
 
-#endif /* defined(_PR_DCETHREADS) */
-
 /*
  * Linux pthreads use SIGUSR1 and SIGUSR2 internally, which
  * conflict with the use of these two signals in our GC support.
  * So we don't know how to support GC on Linux pthreads.
  */
 static void init_pthread_gc_support(void)
 {
 #ifndef SYMBIAN
     PRIntn rv;
 
-#if defined(_PR_DCETHREADS)
-	rv = sigemptyset(&javagc_vtalarm_sigmask);
-    PR_ASSERT(0 == rv);
-	rv = sigaddset(&javagc_vtalarm_sigmask, SIGVTALRM);
-    PR_ASSERT(0 == rv);
-#else  /* defined(_PR_DCETHREADS) */
 	{
 	    struct sigaction sigact_usr2;
 
 	    sigact_usr2.sa_handler = suspend_signal_handler;
 	    sigact_usr2.sa_flags = SA_RESTART;
 	    sigemptyset (&sigact_usr2.sa_mask);
 
         rv = sigaction (SIGUSR2, &sigact_usr2, NULL);
@@ -1264,17 +1203,16 @@ static void init_pthread_gc_support(void
 	    struct sigaction sigact_null;
 	    sigact_null.sa_handler = null_signal_handler;
 	    sigact_null.sa_flags = SA_RESTART;
 	    sigemptyset (&sigact_null.sa_mask);
         rv = sigaction (SIGUSR1, &sigact_null, NULL);
 	    PR_ASSERT(0 ==rv); 
     }
 #endif  /* defined(PT_NO_SIGTIMEDWAIT) */
-#endif /* defined(_PR_DCETHREADS) */
 #endif /* SYMBIAN */
 }
 
 PR_IMPLEMENT(void) PR_SetThreadGCAble(void)
 {
     PR_Lock(pt_book.ml);
 	PR_GetCurrentThread()->state |= PT_THREAD_GCABLE;
     PR_Unlock(pt_book.ml);
@@ -1295,20 +1233,18 @@ static PRBool suspendAllSuspended = PR_F
 
 PR_IMPLEMENT(PRStatus) PR_EnumerateThreads(PREnumerator func, void *arg)
 {
     PRIntn count = 0;
     PRStatus rv = PR_SUCCESS;
     PRThread* thred = pt_book.first;
 
 #if defined(DEBUG) || defined(FORCE_PR_ASSERT)
-#if !defined(_PR_DCETHREADS)
     PRThread *me = PR_GetCurrentThread();
 #endif
-#endif
 
     PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin PR_EnumerateThreads\n"));
     /*
      * $$$
      * Need to suspend all threads other than me before doing this.
      * This is really a gross and disgusting thing to do. The only
      * good thing is that since all other threads are suspended, holding
      * the lock during a callback seems like child's play.
@@ -1326,19 +1262,17 @@ PR_IMPLEMENT(PRStatus) PR_EnumerateThrea
          *
          * To get around this problem, we save qp->next in qp_next before applying
          * "func" and use that saved value as the next value after applying "func".
          */
         PRThread* next = thred->next;
 
         if (_PT_IS_GCABLE_THREAD(thred))
         {
-#if !defined(_PR_DCETHREADS)
             PR_ASSERT((thred == me) || (thred->suspend & PT_THREAD_SUSPENDED));
-#endif
             PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, 
                    ("In PR_EnumerateThreads callback thread %p thid = %X\n", 
                     thred, thred->id));
 
             rv = func(thred, count++, arg);
             if (rv != PR_SUCCESS)
                 return rv;
         }
@@ -1356,18 +1290,16 @@ PR_IMPLEMENT(PRStatus) PR_EnumerateThrea
  * the resume call.  Since the signal handler is the last routine called for the
  * suspended thread, the stack pointer will also serve as a place where all the
  * registers have been saved on the stack for the previously executing routines.
  *
  * Through global variables, we also make sure that PR_Suspend and PR_Resume does not
  * proceed until the thread is suspended or resumed.
  */
 
-#if !defined(_PR_DCETHREADS)
-
 /*
  * In the signal handler, we can not use condition variable notify or wait.
  * This does not work consistently across all pthread platforms.  We also can not 
  * use locking since that does not seem to work reliably across platforms.
  * Only thing we can do is yielding while testing for a global condition
  * to change.  This does work on pthread supported platforms.  We may have
  * to play with priortities if there are any problems detected.
  */
@@ -1656,88 +1588,16 @@ PR_IMPLEMENT(void) PR_ResumeAll(void)
 PR_IMPLEMENT(void *)PR_GetSP(PRThread *thred)
 {
     PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, 
 	    ("in PR_GetSP thred %p thid = %X, sp = %p\n", 
 	    thred, thred->id, thred->sp));
     return thred->sp;
 }  /* PR_GetSP */
 
-#else /* !defined(_PR_DCETHREADS) */
-
-static pthread_once_t pt_gc_support_control = pthread_once_init;
-
-/*
- * For DCE threads, there is no pthread_kill or a way of suspending or resuming a
- * particular thread.  We will just disable the preemption (virtual timer alarm) and
- * let the executing thread finish the garbage collection.  This stops all other threads
- * (GC able or not) and is very inefficient but there is no other choice.
- */
-PR_IMPLEMENT(void) PR_SuspendAll()
-{
-    PRIntn rv;
-
-    rv = pthread_once(&pt_gc_support_control, init_pthread_gc_support);
-    PR_ASSERT(0 == rv);  /* returns -1 on failure */
-#ifdef DEBUG
-    suspendAllOn = PR_TRUE;
-#endif
-    PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin PR_SuspendAll\n"));
-    /* 
-     * turn off preemption - i.e add virtual alarm signal to the set of 
-     * blocking signals 
-     */
-    rv = sigprocmask(
-        SIG_BLOCK, &javagc_vtalarm_sigmask, &javagc_intsoff_sigmask);
-    PR_ASSERT(0 == rv);
-    suspendAllSuspended = PR_TRUE;
-    PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("End PR_SuspendAll\n"));
-}  /* PR_SuspendAll */
-
-PR_IMPLEMENT(void) PR_ResumeAll()
-{
-    PRIntn rv;
-    
-    suspendAllSuspended = PR_FALSE;
-    PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin PR_ResumeAll\n"));
-    /* turn on preemption - i.e re-enable virtual alarm signal */
-
-    rv = sigprocmask(SIG_SETMASK, &javagc_intsoff_sigmask, (sigset_t *)NULL);
-    PR_ASSERT(0 == rv);
-#ifdef DEBUG
-    suspendAllOn = PR_FALSE;
-#endif
-
-    PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("End PR_ResumeAll\n"));
-}  /* PR_ResumeAll */
-
-/* Return the stack pointer for the given thread- used by the GC */
-PR_IMPLEMENT(void*)PR_GetSP(PRThread *thred)
-{
-	pthread_t tid = thred->id;
-	char *thread_tcb, *top_sp;
-
-	/*
-	 * For HPUX DCE threads, pthread_t is a struct with the
-	 * following three fields (see pthread.h, dce/cma.h):
-	 *     cma_t_address       field1;
-	 *     short int           field2;
-	 *     short int           field3;
-	 * where cma_t_address is typedef'd to be either void*
-	 * or char*.
-	 */
-	PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin PR_GetSP\n"));
-	thread_tcb = (char*)tid.field1;
-	top_sp = *(char**)(thread_tcb + 128);
-	PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("End PR_GetSP %p \n", top_sp));
-	return top_sp;
-}  /* PR_GetSP */
-
-#endif /* !defined(_PR_DCETHREADS) */
-
 PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name)
 {
     PRThread *thread;
     size_t nameLen;
     int result = 0;
 
     if (!name) {
         PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
@@ -1812,11 +1672,11 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThre
 
 PR_IMPLEMENT(const char *) PR_GetThreadName(const PRThread *thread)
 {
     if (!thread)
         return NULL;
     return thread->name;
 }
 
-#endif  /* defined(_PR_PTHREADS) || defined(_PR_DCETHREADS) */
+#endif  /* defined(_PR_PTHREADS) */
 
 /* ptthread.c */
--- a/nsprpub/pr/src/threads/prrwlock.c
+++ b/nsprpub/pr/src/threads/prrwlock.c
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "primpl.h"
 
 #include <string.h>
 
-#if defined(HPUX) && defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(HPUX) && defined(_PR_PTHREADS)
 
 #include <pthread.h>
 #define HAVE_UNIX98_RWLOCK
 #define RWLOCK_T pthread_rwlock_t
 #define RWLOCK_INIT(lock) pthread_rwlock_init(lock, NULL)
 #define RWLOCK_DESTROY(lock) pthread_rwlock_destroy(lock)
 #define RWLOCK_RDLOCK(lock) pthread_rwlock_rdlock(lock)
 #define RWLOCK_WRLOCK(lock) pthread_rwlock_wrlock(lock)
--- a/nsprpub/pr/tests/Makefile.in
+++ b/nsprpub/pr/tests/Makefile.in
@@ -368,19 +368,16 @@ endif
 ifeq ($(USE_PTHREADS),1)
 LIBPTHREAD = -lpthread
 ifeq ($(OS_ARCH),AIX)
 LIBPTHREAD = -lpthreads
 endif
 ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
 LIBPTHREAD =
 endif
-ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
-LIBPTHREAD = -ldce
-endif
 endif
 
 ifeq ($(OS_TARGET),Android)
 LIBPTHREAD =
 XCFLAGS = $(OS_CFLAGS)
 endif
 
 #####################################################
--- a/nsprpub/pr/tests/attach.c
+++ b/nsprpub/pr/tests/attach.c
@@ -106,26 +106,16 @@ static unsigned __stdcall threadStartFun
 #elif defined(IRIX) && !defined(_PR_PTHREADS)
 static void threadStartFunc(void *arg)
 #elif defined(XP_BEOS)
 static int32 threadStartFunc(void *arg)
 #else
 static void * threadStartFunc(void *arg)
 #endif
 {
-#ifdef _PR_DCETHREADS
-    {
-        int rv;
-        pthread_t self = pthread_self();
-        rv = pthread_detach(&self);
-        if (debug_mode) PR_ASSERT(0 == rv);
-		else if (0 != rv) failed_already=1;
-    }
-#endif
-
     Measure(AttachDetach, "Attach/Detach");
 
 #ifndef IRIX
     return 0;
 #endif
 }
 
 int main(int argc, char **argv)
@@ -201,24 +191,22 @@ int main(int argc, char **argv)
 
     rv = _PT_PTHREAD_ATTR_INIT(&attr);
     if (debug_mode) PR_ASSERT(0 == rv);
 	else if (0 != rv) {
 		failed_already=1;
 		goto exit_now;
 	}
 	
-#ifndef _PR_DCETHREADS
     rv = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
     if (debug_mode) PR_ASSERT(0 == rv);
 	else if (0 != rv) {
 		failed_already=1;
 		goto exit_now;
 	}
-#endif  /* !_PR_DCETHREADS */
     rv = _PT_PTHREAD_CREATE(&threadID, attr, threadStartFunc, NULL);
     if (rv != 0) {
 			fprintf(stderr, "thread creation failed: error code %d\n", rv);
 			failed_already=1;
 			goto exit_now;
 	}
 	else {
 		if (debug_mode)
--- a/nsprpub/pr/tests/dceemu.c
+++ b/nsprpub/pr/tests/dceemu.c
@@ -24,18 +24,16 @@
 
 #include "prlog.h"
 #include "prinit.h"
 #include "prpdce.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
-#if defined(_PR_DCETHREADS)
-
 PRIntn failed_already=0;
 PRIntn debug_mode=0;
 
 static PRIntn prmain(PRIntn argc, char **argv)
 {
     PRStatus rv;
     PRLock *ml = PR_NewLock();
     PRCondVar *cv = PRP_NewNakedCondVar();
@@ -75,26 +73,19 @@ static PRIntn prmain(PRIntn argc, char *
     PR_DestroyLock(ml);
 
     if (debug_mode) printf("Test succeeded\n");
 
     return 0;
 
 }  /* prmain */
 
-#endif /* #if defined(_PR_DCETHREADS) */
-
 int main(int argc, char **argv)
 {
-
-#if defined(_PR_DCETHREADS)
     PR_Initialize(prmain, argc, argv, 0);
     if(failed_already)    
         return 1;
     else
         return 0;
-#else
-    return 0;
-#endif
 }  /* main */
 
 
 /* decemu.c */
--- a/nsprpub/pr/tests/foreign.c
+++ b/nsprpub/pr/tests/foreign.c
@@ -47,28 +47,28 @@ typedef struct StartObject
 static PRFileDesc *output;
 
 static int _debug_on = 0;
 
 #define DEFAULT_THREAD_COUNT	10
 
 #define DPRINTF(arg)	if (_debug_on) PR_fprintf arg
 
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #include <pthread.h>
 #include "md/_pth.h"
 static void *pthread_start(void *arg)
 {
     StartFn start = ((StartObject*)arg)->start;
     void *data = ((StartObject*)arg)->arg;
     PR_Free(arg);
     start(data);
     return NULL;
 }  /* pthread_start */
-#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */
+#endif /* defined(_PR_PTHREADS) */
 
 #if defined(IRIX) && !defined(_PR_PTHREADS)
 #include <sys/types.h>
 #include <sys/prctl.h>
 static void sproc_start(void *arg, PRSize size)
 {
     StartObject *so = (StartObject*)arg;
     StartFn start = so->start;
@@ -104,17 +104,17 @@ static PRStatus NSPRPUB_TESTS_CreateThre
             PRThread *thread = PR_CreateThread(
                 PR_USER_THREAD, start, arg,
                 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
                 PR_UNJOINABLE_THREAD, 0);
             rv = (NULL == thread) ? PR_FAILURE : PR_SUCCESS;
         }
         break;
     case thread_pthread:
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
         {
             int rv;
             pthread_t id;
             pthread_attr_t tattr;
             StartObject *start_object;
             start_object = PR_NEW(StartObject);
             PR_ASSERT(NULL != start_object);
             start_object->start = start;
@@ -132,17 +132,17 @@ static PRStatus NSPRPUB_TESTS_CreateThre
             rv = _PT_PTHREAD_CREATE(&id, tattr, pthread_start, start_object);
             (void)_PT_PTHREAD_ATTR_DESTROY(&tattr);
             return (0 == rv) ? PR_SUCCESS : PR_FAILURE;
         }
 #else
         PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
         rv = PR_FAILURE;
         break;
-#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */
+#endif /* defined(_PR_PTHREADS) */
 
     case thread_sproc:
 #if defined(IRIX) && !defined(_PR_PTHREADS)
         {
             PRInt32 pid;
             StartObject *start_object;
             start_object = PR_NEW(StartObject);
             PR_ASSERT(NULL != start_object);
--- a/nsprpub/pr/tests/forktest.c
+++ b/nsprpub/pr/tests/forktest.c
@@ -191,71 +191,26 @@ finish:
         PR_Close(listenSock);
     }
     if (sock) {
         PR_Close(sock);
     }
     return;
 }
 
-#ifdef _PR_DCETHREADS
-
-#include <syscall.h>
-
-pid_t PR_UnixFork1(void)
-{
-    pid_t parent = getpid();
-    int rv = syscall(SYS_fork);
-
-    if (rv == -1) {
-        return (pid_t) -1;
-    } else {
-        /* For each process, rv is the pid of the other process */
-        if (rv == parent) {
-            /* the child */
-            return 0;
-        } else {
-            /* the parent */
-            return rv;
-        }
-    }
-}
-
-#elif defined(SOLARIS)
-
-/*
- * It seems like that in Solaris 2.4 one must call fork1() if the
- * the child process is going to use thread functions.  Solaris 2.5
- * doesn't have this problem. Calling fork() also works. 
- */
-
-pid_t PR_UnixFork1(void)
-{
-    return fork1();
-}
-
-#else
-
-pid_t PR_UnixFork1(void)
-{
-    return fork();
-}
-
-#endif  /* PR_DCETHREADS */
-
 int main(int argc, char **argv)
 {
     pid_t pid;
 	int rv;
 
     /* main test program */
 
     DoIO();
 
-    pid = PR_UnixFork1();
+    pid = fork();
 
     if (pid  == (pid_t) -1) {
         fprintf(stderr, "Fork failed: errno %d\n", errno);
         failed_already=1;
         return 1;
     } else if (pid > 0) {
         int childStatus;
 
--- a/nsprpub/pr/tests/provider.c
+++ b/nsprpub/pr/tests/provider.c
@@ -601,30 +601,30 @@ exit:
 
 typedef void (*StartFn)(void*);
 typedef struct StartObject
 {
     StartFn start;
     void *arg;
 } StartObject;
 
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #include "md/_pth.h"
 #include <pthread.h>
 
 static void *pthread_start(void *arg)
 {
     StartObject *so = (StartObject*)arg;
     StartFn start = so->start;
     void *data = so->arg;
     PR_Free(so);
     start(data);
     return NULL;
 }  /* pthread_start */
-#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */
+#endif /* defined(_PR_PTHREADS) */
 
 #if defined(IRIX) && !defined(_PR_PTHREADS)
 #include <sys/types.h>
 #include <sys/prctl.h>
 static void sproc_start(void *arg, PRSize size)
 {
     StartObject *so = (StartObject*)arg;
     StartFn start = so->start;
@@ -652,20 +652,20 @@ static PRStatus JoinThread(PRThread *thr
 {
     PRStatus rv;
     switch (thread_provider)
     {
     case thread_nspr:
         rv = PR_JoinThread(thread);
         break;
     case thread_pthread:
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
         rv = PR_SUCCESS;
         break;
-#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */
+#endif /* defined(_PR_PTHREADS) */
     case thread_win32:
 #if defined(WIN32)
         rv = PR_SUCCESS;
         break;
 #endif
     default:
         rv = PR_FAILURE;
         break;
@@ -685,17 +685,17 @@ static PRStatus NewThread(
             PRThread *thread = PR_CreateThread(
                 PR_USER_THREAD, start, arg,
                 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
                 PR_JOINABLE_THREAD, 0);
             rv = (NULL == thread) ? PR_FAILURE : PR_SUCCESS;
         }
         break;
     case thread_pthread:
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
         {
             int rv;
             pthread_t id;
             pthread_attr_t tattr;
             StartObject *start_object;
             start_object = PR_NEW(StartObject);
             PR_ASSERT(NULL != start_object);
             start_object->start = start;
@@ -712,17 +712,17 @@ static PRStatus NewThread(
 
             rv = _PT_PTHREAD_CREATE(&id, tattr, pthread_start, start_object);
             (void)_PT_PTHREAD_ATTR_DESTROY(&tattr);
             return (0 == rv) ? PR_SUCCESS : PR_FAILURE;
         }
 #else
         PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
         rv = PR_FAILURE;
-#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */
+#endif /* defined(_PR_PTHREADS) */
         break;
 
     case thread_sproc:
 #if defined(IRIX) && !defined(_PR_PTHREADS)
         {
             PRInt32 pid;
             StartObject *start_object;
             start_object = PR_NEW(StartObject);
--- a/nsprpub/pr/tests/socket.c
+++ b/nsprpub/pr/tests/socket.c
@@ -16,17 +16,17 @@
 #include "plgetopt.h"
 
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #ifdef XP_UNIX
 #include <sys/mman.h>
 #endif
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #include <pthread.h>
 #endif
 
 #ifdef WIN32
 #include <process.h>
 #endif
 
 static int _debug_on = 0;
@@ -308,17 +308,17 @@ PRThread* create_new_thread(PRThreadType
 							PRThreadPriority priority,
 							PRThreadScope scope,
 							PRThreadState state,
 							PRUint32 stackSize, PRInt32 index)
 {
 PRInt32 native_thread = 0;
 
 	PR_ASSERT(state == PR_UNJOINABLE_THREAD);
-#if (defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)) || defined(WIN32)
+#if defined(_PR_PTHREADS) || defined(WIN32)
 	switch(index %  4) {
 		case 0:
 			scope = (PR_LOCAL_THREAD);
 			break;
 		case 1:
 			scope = (PR_GLOBAL_THREAD);
 			break;
 		case 2:
@@ -327,17 +327,17 @@ PRInt32 native_thread = 0;
 		case 3:
 			native_thread = 1;
 			break;
 		default:
 			PR_NOT_REACHED("Invalid scope");
 			break;
 	}
 	if (native_thread) {
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 		pthread_t tid;
 		if (!pthread_create(&tid, NULL, (void * (*)(void *)) start, arg))
 			return((PRThread *) tid);
 		else
 			return (NULL);
 #else
 		HANDLE thandle;
 		unsigned tid;
--- a/nsprpub/pr/tests/testfile.c
+++ b/nsprpub/pr/tests/testfile.c
@@ -8,17 +8,17 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #ifdef WIN32
 #include <windows.h>
 #include <process.h>
 #endif
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #include <pthread.h>
 #endif
 #ifdef SYMBIAN
 #include <getopt.h>
 #endif
 
 #if defined(XP_OS2)
 #define INCL_DOSFILEMGR
@@ -99,17 +99,17 @@ PRThread* create_new_thread(PRThreadType
 							PRThreadScope scope,
 							PRThreadState state,
 							PRUint32 stackSize, PRInt32 index)
 {
 PRInt32 native_thread = 0;
 
 	PR_ASSERT(state == PR_UNJOINABLE_THREAD);
 
-#if (defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)) || defined(WIN32) || defined(XP_OS2)
+#if defined(_PR_PTHREADS) || defined(WIN32) || defined(XP_OS2)
 
 	switch(index %  4) {
 		case 0:
 			scope = (PR_LOCAL_THREAD);
 			break;
 		case 1:
 			scope = (PR_GLOBAL_THREAD);
 			break;
@@ -119,17 +119,17 @@ PRInt32 native_thread = 0;
 		case 3:
 			native_thread = 1;
 			break;
 		default:
 			PR_NOT_REACHED("Invalid scope");
 			break;
 	}
 	if (native_thread) {
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 		pthread_t tid;
 		if (!pthread_create(&tid, NULL, start, arg))
 			return((PRThread *) tid);
 		else
 			return (NULL);
 #elif defined(XP_OS2)
         TID tid;
 
--- a/nsprpub/pr/tests/thrpool_client.c
+++ b/nsprpub/pr/tests/thrpool_client.c
@@ -16,17 +16,17 @@
 #include "plgetopt.h"
 
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #ifdef XP_UNIX
 #include <sys/mman.h>
 #endif
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #include <pthread.h>
 #endif
 
 #ifdef WIN32
 #include <process.h>
 #endif
 
 static int _debug_on = 0;
--- a/nsprpub/pr/tests/thrpool_server.c
+++ b/nsprpub/pr/tests/thrpool_server.c
@@ -16,17 +16,17 @@
 #include "plgetopt.h"
 
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #ifdef XP_UNIX
 #include <sys/mman.h>
 #endif
-#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
+#if defined(_PR_PTHREADS)
 #include <pthread.h>
 #endif
 
 /* for getcwd */
 #if defined(XP_UNIX) || defined (XP_OS2) || defined(XP_BEOS)
 #include <unistd.h>
 #elif defined(XP_PC)
 #include <direct.h>