Index: trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_solaris.h
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_solaris.h	(revision 101809)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_solaris.h	(revision 101810)
@@ -94,9 +94,9 @@
  * 64-bit Solaris requires sparc v9, which has atomic instructions.
  */
-#if defined(i386) || defined(_PR_GLOBAL_THREADS_ONLY) || defined(IS_64)
+#if defined(i386) || defined(IS_64)
 #define _PR_HAVE_ATOMIC_OPS
 #endif
 
-#if defined(_PR_GLOBAL_THREADS_ONLY) || defined(_PR_PTHREADS)
+#if defined(_PR_PTHREADS)
 /*
  * We have assembly language implementation of atomic
@@ -167,5 +167,5 @@
 };
 #endif
-#if defined(_PR_GLOBAL_THREADS_ONLY) || defined(_PR_PTHREADS)
+#if defined(_PR_PTHREADS)
 #define _PR_HAVE_GETHOST_R
 #define _PR_HAVE_GETHOST_R_POINTER
@@ -180,6 +180,4 @@
 #include "_iprt_atomic.h"
 
-#if defined(_PR_PTHREADS)
-
 NSPR_API(void)		_MD_EarlyInit(void);
 
@@ -187,627 +185,4 @@
 #define _MD_FINAL_INIT		_PR_UnixInit
 
-#elif defined(_PR_GLOBAL_THREADS_ONLY)
-
-#include "prthread.h"
-
-#include <ucontext.h>
-
-/*
-** Iinitialization Related definitions
-*/
-
-NSPR_API(void)		_MD_EarlyInit(void);
-
-#define _MD_EARLY_INIT		_MD_EarlyInit
-#define _MD_FINAL_INIT		_PR_UnixInit
-
-#define _MD_GET_SP(threadp)	threadp->md.sp
-
-/*
-** Clean-up the thread machine dependent data structure
-*/
-#define	_MD_INIT_THREAD				_MD_InitializeThread
-#define	_MD_INIT_ATTACHED_THREAD	_MD_InitializeThread
-
-NSPR_API(PRStatus) _MD_CreateThread(PRThread *thread, 
-					void (*start)(void *), 
-					PRThreadPriority priority,
-					PRThreadScope scope, 
-					PRThreadState state, 
-					PRUint32 stackSize);
-#define _MD_CREATE_THREAD _MD_CreateThread
-
-#define	_PR_CONTEXT_TYPE	ucontext_t
-
-#define CONTEXT(_thread) (&(_thread)->md.context)
-
-#include <thread.h>
-#include <sys/lwp.h>
-#include <synch.h>
-
-extern struct PRLock *_pr_schedLock;
-
-/*
-** Thread Local Storage 
-*/
-
-#define THREAD_KEY_T thread_key_t
-
-extern struct PRThread *_pr_attached_thread_tls();
-extern struct PRThread *_pr_current_thread_tls();
-extern struct _PRCPU *_pr_current_cpu_tls();
-extern struct PRThread *_pr_last_thread_tls();
-
-extern THREAD_KEY_T threadid_key;
-extern THREAD_KEY_T cpuid_key;
-extern THREAD_KEY_T last_thread_key;
-
-#define _MD_GET_ATTACHED_THREAD() _pr_attached_thread_tls()
-#define _MD_CURRENT_THREAD() _pr_current_thread_tls()
-#define _MD_CURRENT_CPU() _pr_current_cpu_tls()
-#define _MD_LAST_THREAD() _pr_last_thread_tls()
-	
-#define _MD_SET_CURRENT_THREAD(newval) 			\
-	PR_BEGIN_MACRO					\
-	thr_setspecific(threadid_key, (void *)newval);	\
-	PR_END_MACRO
-
-#define _MD_SET_CURRENT_CPU(newval) 			\
-	PR_BEGIN_MACRO					\
-	thr_setspecific(cpuid_key, (void *)newval);	\
-	PR_END_MACRO
-
-#define _MD_SET_LAST_THREAD(newval)	 			\
-	PR_BEGIN_MACRO						\
-	thr_setspecific(last_thread_key, (void *)newval);	\
-	PR_END_MACRO
-	
-#define	_MD_CLEAN_THREAD(_thread)	_MD_cleanup_thread(_thread)
-extern void _MD_exit_thread(PRThread *thread);
-#define _MD_EXIT_THREAD(thread)		_MD_exit_thread(thread)
-
-#define	_MD_SUSPEND_THREAD(thread)	_MD_Suspend(thread)
-#define	_MD_RESUME_THREAD(thread)	thr_continue((thread)->md.handle)
-
-/* XXXX Needs to be defined - Prashant */
-#define _MD_SUSPEND_CPU(cpu)
-#define _MD_RESUME_CPU(cpu)
-
-extern void _MD_Begin_SuspendAll(void);
-extern void _MD_End_SuspendAll(void);
-extern void _MD_End_ResumeAll(void);
-#define _MD_BEGIN_SUSPEND_ALL()		_MD_Begin_SuspendAll()
-#define _MD_BEGIN_RESUME_ALL()		
-#define	_MD_END_SUSPEND_ALL()		_MD_End_SuspendAll()
-#define	_MD_END_RESUME_ALL()		_MD_End_ResumeAll()
-
-#define _MD_INIT_LOCKS()
-#define _MD_NEW_LOCK(md_lockp) (mutex_init(&((md_lockp)->lock),USYNC_THREAD,NULL) ? PR_FAILURE : PR_SUCCESS)
-#define _MD_FREE_LOCK(md_lockp) mutex_destroy(&((md_lockp)->lock))
-#define _MD_UNLOCK(md_lockp) mutex_unlock(&((md_lockp)->lock))
-#define _MD_TEST_AND_LOCK(md_lockp) mutex_trylock(&((md_lockp)->lock))
-struct _MDLock;
-NSPR_API(void) _MD_lock(struct _MDLock *md_lock);
-#undef PROFILE_LOCKS
-#ifndef PROFILE_LOCKS
-#define _MD_LOCK(md_lockp) _MD_lock(md_lockp)
-#else
-#define _MD_LOCK(md_lockp)                 \
-    PR_BEGIN_MACRO \
-    int rv = _MD_TEST_AND_LOCK(md_lockp); \
-    if (rv == 0) { \
-        (md_lockp)->hitcount++; \
-    } else { \
-        (md_lockp)->misscount++; \
-        _MD_lock(md_lockp); \
-    } \
-    PR_END_MACRO
-#endif
-
-#define _PR_LOCK_HEAP() if (_pr_heapLock) _MD_LOCK(&_pr_heapLock->md)
-#define _PR_UNLOCK_HEAP() if (_pr_heapLock) _MD_UNLOCK(&_pr_heapLock->md)
-
-#define _MD_ATTACH_THREAD(threadp)
-
-
-#define THR_KEYCREATE thr_keycreate
-#define THR_SELF thr_self
-#define _MD_NEW_CV(condp) cond_init(&((condp)->cv), USYNC_THREAD, 0)
-#define COND_WAIT(condp, mutexp) cond_wait(condp, mutexp)
-#define COND_TIMEDWAIT(condp, mutexp, tspec) \
-                                     cond_timedwait(condp, mutexp, tspec)
-#define _MD_NOTIFY_CV(condp, lockp) cond_signal(&((condp)->cv))
-#define _MD_NOTIFYALL_CV(condp,unused) cond_broadcast(&((condp)->cv))	
-#define _MD_FREE_CV(condp) cond_destroy(&((condp)->cv))
-#define _MD_YIELD() thr_yield()
-#include <time.h>
-/* 
- * Because clock_gettime() on Solaris/x86 2.4 always generates a
- * segmentation fault, we use an emulated version _pr_solx86_clock_gettime(),
- * which is implemented using gettimeofday().
- */
-#if defined(i386) && defined(SOLARIS2_4)
-extern int _pr_solx86_clock_gettime(clockid_t clock_id, struct timespec *tp);
-#define GETTIME(tt) _pr_solx86_clock_gettime(CLOCK_REALTIME, (tt))
-#else
-#define GETTIME(tt) clock_gettime(CLOCK_REALTIME, (tt))
-#endif  /* i386 && SOLARIS2_4 */
-
-#define MUTEX_T mutex_t
-#define COND_T cond_t
-
-#define _MD_NEW_SEM(md_semp,_val)  sema_init(&((md_semp)->sem),_val,USYNC_THREAD,NULL)
-#define _MD_DESTROY_SEM(md_semp) sema_destroy(&((md_semp)->sem))
-#define _MD_WAIT_SEM(md_semp) sema_wait(&((md_semp)->sem))
-#define _MD_POST_SEM(md_semp) sema_post(&((md_semp)->sem))
-
-#define _MD_SAVE_ERRNO(_thread)
-#define _MD_RESTORE_ERRNO(_thread)
-#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
-
-extern struct _MDLock _pr_ioq_lock;
-#define _MD_IOQ_LOCK()		_MD_LOCK(&_pr_ioq_lock)
-#define _MD_IOQ_UNLOCK()	_MD_UNLOCK(&_pr_ioq_lock)
-
-extern PRStatus _MD_wait(struct PRThread *, PRIntervalTime timeout);
-#define _MD_WAIT _MD_wait
-
-extern PRStatus _MD_WakeupWaiter(struct PRThread *);
-#define _MD_WAKEUP_WAITER _MD_WakeupWaiter
-
-NSPR_API(void) _MD_InitIO(void);
-#define _MD_INIT_IO _MD_InitIO
-
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
-    PR_BEGIN_MACRO \
-    *status = PR_TRUE; \
-    PR_END_MACRO
-#define _MD_SWITCH_CONTEXT(_thread)
-#define _MD_RESTORE_CONTEXT(_newThread)
-
-struct _MDLock {
-    MUTEX_T lock;
-#ifdef PROFILE_LOCKS
-    PRInt32 hitcount;
-    PRInt32 misscount;
-#endif
-};
-
-struct _MDCVar {
-    COND_T cv;
-};
-
-struct _MDSemaphore {
-    sema_t sem;
-};
-
-struct _MDThread {
-    _PR_CONTEXT_TYPE context;
-    thread_t handle;
-    lwpid_t lwpid;
-    uint_t sp;		/* stack pointer */
-    uint_t threadID;	/* ptr to solaris-internal thread id structures */
-    struct _MDSemaphore waiter_sem;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field, common to all Unix platforms
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-/* The following defines the unwrapped versions of select() and poll(). */
-extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
-	fd_set *exceptfds, struct timeval *timeout);
-#define _MD_SELECT	_select
-
-#include <poll.h>
-#define _MD_POLL _poll
-extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
-
-PR_BEGIN_EXTERN_C
-
-/*
-** Missing function prototypes
-*/
-extern int gethostname (char *name, int namelen);
-
-PR_END_EXTERN_C
-
-#else /* _PR_GLOBAL_THREADS_ONLY */
-
-/*
- * LOCAL_THREADS_ONLY implementation on Solaris
- */
-
-#include "prthread.h"
-
-#include <errno.h>
-#include <ucontext.h>
-#include <sys/stack.h>
-#include <synch.h>
-
-/*
-** Iinitialization Related definitions
-*/
-
-NSPR_API(void)				_MD_EarlyInit(void);
-NSPR_API(void)				_MD_SolarisInit();
-#define _MD_EARLY_INIT		_MD_EarlyInit
-#define _MD_FINAL_INIT		_MD_SolarisInit
-#define	_MD_INIT_THREAD		_MD_InitializeThread
-
-#ifdef USE_SETJMP
-
-#include <setjmp.h>
-
-#define _PR_CONTEXT_TYPE	jmp_buf
-
-#ifdef sparc
-#define _MD_GET_SP(_t)		(_t)->md.context[2]
-#else
-#define _MD_GET_SP(_t)		(_t)->md.context[4]
-#endif
-
-#define PR_NUM_GCREGS		_JBLEN
-#define CONTEXT(_thread)	(_thread)->md.context
-
-#else  /* ! USE_SETJMP */
-
-#ifdef sparc
-#define	_PR_CONTEXT_TYPE	ucontext_t
-#define _MD_GET_SP(_t)		(_t)->md.context.uc_mcontext.gregs[REG_SP]
-/*
-** Sparc's use register windows. the _MD_GetRegisters for the sparc's
-** doesn't actually store anything into the argument buffer; instead the
-** register windows are homed to the stack. I assume that the stack
-** always has room for the registers to spill to...
-*/
-#define PR_NUM_GCREGS		0
-#else
-#define _PR_CONTEXT_TYPE	unsigned int edi; sigset_t oldMask, blockMask; ucontext_t
-#define _MD_GET_SP(_t)		(_t)->md.context.uc_mcontext.gregs[USP]
-#define PR_NUM_GCREGS		_JBLEN
-#endif
-
-#define CONTEXT(_thread)	(&(_thread)->md.context)
-
-#endif /* ! USE_SETJMP */
-
-#include <time.h>
-/* 
- * Because clock_gettime() on Solaris/x86 always generates a
- * segmentation fault, we use an emulated version _pr_solx86_clock_gettime(),
- * which is implemented using gettimeofday().
- */
-#ifdef i386
-#define GETTIME(tt) _pr_solx86_clock_gettime(CLOCK_REALTIME, (tt))
-#else
-#define GETTIME(tt) clock_gettime(CLOCK_REALTIME, (tt))
-#endif  /* i386 */
-
-#define _MD_SAVE_ERRNO(_thread)			(_thread)->md.errcode = errno;
-#define _MD_RESTORE_ERRNO(_thread)		errno = (_thread)->md.errcode;
-
-#ifdef sparc
-
-#ifdef USE_SETJMP
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)	      \
-    PR_BEGIN_MACRO				      \
-	int *context = (_thread)->md.context;	      \
-    *status = PR_TRUE;              \
-	(void) setjmp(context);			      \
-	(_thread)->md.context[1] = (int) ((_sp) - 64); \
-	(_thread)->md.context[2] = (int) _main;	      \
-	(_thread)->md.context[3] = (int) _main + 4; \
-    _thread->no_sched = 0; \
-    PR_END_MACRO
-
-#define _MD_SWITCH_CONTEXT(_thread)    \
-    if (!setjmp(CONTEXT(_thread))) { \
-	_MD_SAVE_ERRNO(_thread)    \
-	_MD_SET_LAST_THREAD(_thread);	 \
-    _MD_SET_CURRENT_THREAD(_thread);	 \
-	_PR_Schedule();		     \
-    }
-
-#define _MD_RESTORE_CONTEXT(_newThread)	    \
-{				     \
-	_MD_RESTORE_ERRNO(_newThread)	    \
-	_MD_SET_CURRENT_THREAD(_newThread); \
-    longjmp(CONTEXT(_newThread), 1);    \
-}
-
-#else
-/*
-** Initialize the thread context preparing it to execute _main.
-*/
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)					\
-    PR_BEGIN_MACRO				      									\
-    ucontext_t *uc = CONTEXT(_thread);									\
-    *status = PR_TRUE;													\
-    getcontext(uc);														\
-    uc->uc_stack.ss_sp = (char *) ((unsigned long)(_sp - WINDOWSIZE - SA(MINFRAME)) & 0xfffffff8);	\
-    uc->uc_stack.ss_size = _thread->stack->stackSize; 					\
-    uc->uc_stack.ss_flags = 0; 				/* ? */		        		\
-    uc->uc_mcontext.gregs[REG_SP] = (unsigned int) uc->uc_stack.ss_sp;	\
-    uc->uc_mcontext.gregs[REG_PC] = (unsigned int) _main;				\
-    uc->uc_mcontext.gregs[REG_nPC] = (unsigned int) ((char*)_main)+4;	\
-    uc->uc_flags = UC_ALL;												\
-    _thread->no_sched = 0;												\
-    PR_END_MACRO
-
-/*
-** Switch away from the current thread context by saving its state and
-** calling the thread scheduler. Reload cpu when we come back from the
-** context switch because it might have changed.
-*/
-#define _MD_SWITCH_CONTEXT(_thread)    				\
-    PR_BEGIN_MACRO                     				\
-		if (!getcontext(CONTEXT(_thread))) { 		\
-			_MD_SAVE_ERRNO(_thread);    			\
-			_MD_SET_LAST_THREAD(_thread);	 		\
-			_PR_Schedule();			 				\
-		}					 						\
-    PR_END_MACRO
-
-/*
-** Restore a thread context that was saved by _MD_SWITCH_CONTEXT or
-** initialized by _MD_INIT_CONTEXT.
-*/
-#define _MD_RESTORE_CONTEXT(_newThread)	    				\
-    PR_BEGIN_MACRO			    							\
-    	ucontext_t *uc = CONTEXT(_newThread); 				\
-    	uc->uc_mcontext.gregs[11] = 1;     					\
-		_MD_RESTORE_ERRNO(_newThread);	    				\
-		_MD_SET_CURRENT_THREAD(_newThread); 				\
-    	setcontext(uc);		       							\
-    PR_END_MACRO
-#endif
-
-#else  /* x86 solaris */
-
-#ifdef USE_SETJMP
-
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
-    PR_BEGIN_MACRO \
-    *status = PR_TRUE; \
-    if (setjmp(CONTEXT(_thread))) _main(); \
-    _MD_GET_SP(_thread) = (int) ((_sp) - 64); \
-    PR_END_MACRO
-
-#define _MD_SWITCH_CONTEXT(_thread) \
-    if (!setjmp(CONTEXT(_thread))) { \
-        _MD_SAVE_ERRNO(_thread) \
-        _PR_Schedule();	\
-    }
-
-#define _MD_RESTORE_CONTEXT(_newThread) \
-{ \
-    _MD_RESTORE_ERRNO(_newThread) \
-    _MD_SET_CURRENT_THREAD(_newThread); \
-    longjmp(CONTEXT(_newThread), 1); \
-}
-
-#else /* USE_SETJMP */
-
-#define WINDOWSIZE		0
- 
-int getedi(void);
-void setedi(int);
- 
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)	      \
-	PR_BEGIN_MACRO					\
-	ucontext_t *uc = CONTEXT(_thread);		\
-        *status = PR_TRUE;              \
-	getcontext(uc);					\
-	/* Force sp to be double aligned! */		\
-    	uc->uc_mcontext.gregs[USP] = (int) ((unsigned long)(_sp - WINDOWSIZE - SA(MINFRAME)) & 0xfffffff8);	\
-	uc->uc_mcontext.gregs[PC] = (int) _main;	\
-	(_thread)->no_sched = 0; \
-	PR_END_MACRO
-
-/* getcontext() may return 1, contrary to what the man page says */
-#define _MD_SWITCH_CONTEXT(_thread)			\
-	PR_BEGIN_MACRO					\
-	ucontext_t *uc = CONTEXT(_thread);		\
-	PR_ASSERT(_thread->no_sched);			\
-	sigfillset(&((_thread)->md.blockMask));		\
-	sigprocmask(SIG_BLOCK, &((_thread)->md.blockMask),	\
-		&((_thread)->md.oldMask));		\
-	(_thread)->md.edi = getedi();			\
-	if (! getcontext(uc)) {				\
-		sigprocmask(SIG_SETMASK, &((_thread)->md.oldMask), NULL); \
-		uc->uc_mcontext.gregs[EDI] = (_thread)->md.edi;	\
-		_MD_SAVE_ERRNO(_thread)    		\
-	        _MD_SET_LAST_THREAD(_thread);	        \
-		_PR_Schedule();				\
-	} else {					\
-		sigprocmask(SIG_SETMASK, &((_thread)->md.oldMask), NULL); \
-		setedi((_thread)->md.edi);		\
-		PR_ASSERT(_MD_LAST_THREAD() !=_MD_CURRENT_THREAD()); \
-		_MD_LAST_THREAD()->no_sched = 0;	\
-	}						\
-	PR_END_MACRO
-
-/*
-** Restore a thread context, saved by _PR_SWITCH_CONTEXT
-*/
-#define _MD_RESTORE_CONTEXT(_newthread)			\
-	PR_BEGIN_MACRO					\
-	ucontext_t *uc = CONTEXT(_newthread);		\
-	uc->uc_mcontext.gregs[EAX] = 1;			\
-	_MD_RESTORE_ERRNO(_newthread)  			\
-	_MD_SET_CURRENT_THREAD(_newthread);		\
-	(_newthread)->no_sched = 1;			\
-	setcontext(uc);					\
-	PR_END_MACRO
-#endif /* USE_SETJMP */
-
-#endif /* sparc */
-
-struct _MDLock {
-	PRInt8 notused;
-};
-
-struct _MDCVar {
-	PRInt8 notused;
-};
-
-struct _MDSemaphore {
-	PRInt8 notused;
-};
-
-struct _MDThread {
-    _PR_CONTEXT_TYPE context;
-    int errcode;
-    int id;
-};
-
-struct _MDThreadStack {
-    PRInt8 notused;
-};
-
-struct _MDSegment {
-    PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
-    PRCList ioQ;
-    PRUint32 ioq_timeout;
-    PRInt32 ioq_max_osfd;
-    PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
-    fd_set fd_read_set, fd_write_set, fd_exception_set;
-    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
-				fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
-	struct pollfd *ioq_pollfds;
-	int ioq_pollfds_size;
-#endif	/* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu)			((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu)		((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu)		((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu)	((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)	32
-
-struct _MDCPU {
-	struct _MDCPU_Unix md_unix;
-};
-
-#ifndef _PR_PTHREADS
-#define _MD_INIT_LOCKS()
-#endif
-#define _MD_NEW_LOCK(lock)				PR_SUCCESS
-#define _MD_FREE_LOCK(lock)
-#define _MD_LOCK(lock)
-#define _MD_UNLOCK(lock)
-#define _MD_INIT_IO()
-#define _MD_IOQ_LOCK()
-#define _MD_IOQ_UNLOCK()
-
-#define _MD_INIT_RUNNING_CPU(cpu)		_MD_unix_init_running_cpu(cpu)
-#define _MD_INIT_THREAD					_MD_InitializeThread
-#define _MD_EXIT_THREAD(thread)
-#define _MD_SUSPEND_THREAD(thread)
-#define _MD_RESUME_THREAD(thread)
-#define _MD_CLEAN_THREAD(_thread)
-
-extern PRStatus _MD_WAIT(struct PRThread *, PRIntervalTime timeout);
-extern PRStatus _MD_WAKEUP_WAITER(struct PRThread *);
-extern void     _MD_YIELD(void);
-extern PRStatus _MD_InitializeThread(PRThread *thread);
-extern void     _MD_SET_PRIORITY(struct _MDThread *thread,
-	PRThreadPriority newPri);
-extern PRStatus _MD_CREATE_THREAD(PRThread *thread, void (*start) (void *),
-	PRThreadPriority priority, PRThreadScope scope, PRThreadState state,
-        PRUint32 stackSize);
-
-NSPR_API(PRIntervalTime)				_MD_Solaris_GetInterval(void);
-#define _MD_GET_INTERVAL				_MD_Solaris_GetInterval
-NSPR_API(PRIntervalTime)				_MD_Solaris_TicksPerSecond(void);
-#define _MD_INTERVAL_PER_SEC			_MD_Solaris_TicksPerSecond
-
-/* The following defines the unwrapped versions of select() and poll(). */
-extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
-	fd_set *exceptfds, struct timeval *timeout);
-#define _MD_SELECT	_select
-
-#include <stropts.h>
-#include <poll.h>
-#define _MD_POLL _poll
-extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
-
-PR_BEGIN_EXTERN_C
-
-/*
-** Missing function prototypes
-*/
-extern int gethostname (char *name, int namelen);
-
-PR_END_EXTERN_C
-
-#endif /* _PR_GLOBAL_THREADS_ONLY */
-
 extern void _MD_solaris_map_sendfile_error(int err);
 
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_unixos.h
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_unixos.h	(revision 101809)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_unixos.h	(revision 101810)
@@ -137,8 +137,4 @@
     PRIntervalTime timeout);
 extern void _PR_Unblock_IO_Wait(struct PRThread *thr);
-
-#if defined(_PR_LOCAL_THREADS_ONLY) || defined(_PR_GLOBAL_THREADS_ONLY)
-#define _MD_CHECK_FOR_EXIT()
-#endif
 
 extern fd_set _pr_md_read_set, _pr_md_write_set, _pr_md_exception_set;
@@ -289,8 +285,4 @@
 
 #define _MD_PAUSE_CPU			_MD_PauseCPU
-
-#if defined(_PR_LOCAL_THREADS_ONLY) || defined(_PR_GLOBAL_THREADS_ONLY)
-#define _MD_CLEANUP_BEFORE_EXIT()
-#endif
 
 #ifndef IRIX
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/solaris.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/solaris.c	(revision 101809)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/solaris.c	(revision 101810)
@@ -85,654 +85,2 @@
 }
 
-#if !defined(i386) && !defined(IS_64)
-#if defined(_PR_HAVE_ATOMIC_OPS)
-/* NOTE:
- * SPARC v9 (Ultras) do have an atomic test-and-set operation.  But
- * SPARC v8 doesn't.  We should detect in the init if we are running on
- * v8 or v9, and then use assembly where we can.
- *
- * This code uses the Solaris threads API.  It can be used in both the
- * pthreads and Solaris threads versions of nspr20 because "POSIX threads
- * and Solaris threads are fully compatible even within the same process",
- * to quote from pthread_create(3T).
- */
-
-#include <thread.h>
-#include <synch.h>
-
-static mutex_t _solaris_atomic = DEFAULTMUTEX;
-
-PRInt32
-_MD_AtomicIncrement(PRInt32 *val)
-{
-    PRInt32 rv;
-    if (mutex_lock(&_solaris_atomic) != 0)
-        PR_ASSERT(0);
-
-    rv = ++(*val);
-
-    if (mutex_unlock(&_solaris_atomic) != 0)\
-        PR_ASSERT(0);
-
-	return rv;
-}
-
-PRInt32
-_MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
-{
-    PRInt32 rv;
-    if (mutex_lock(&_solaris_atomic) != 0)
-        PR_ASSERT(0);
-
-    rv = ((*ptr) += val);
-
-    if (mutex_unlock(&_solaris_atomic) != 0)\
-        PR_ASSERT(0);
-
-	return rv;
-}
-
-PRInt32
-_MD_AtomicDecrement(PRInt32 *val)
-{
-    PRInt32 rv;
-    if (mutex_lock(&_solaris_atomic) != 0)
-        PR_ASSERT(0);
-
-    rv = --(*val);
-
-    if (mutex_unlock(&_solaris_atomic) != 0)\
-        PR_ASSERT(0);
-
-	return rv;
-}
-
-PRInt32
-_MD_AtomicSet(PRInt32 *val, PRInt32 newval)
-{
-    PRInt32 rv;
-    if (mutex_lock(&_solaris_atomic) != 0)
-        PR_ASSERT(0);
-
-    rv = *val;
-    *val = newval;
-
-    if (mutex_unlock(&_solaris_atomic) != 0)\
-        PR_ASSERT(0);
-
-	return rv;
-}
-#endif  /* _PR_HAVE_ATOMIC_OPS */
-#endif  /* !defined(i386) */
-
-#if defined(_PR_GLOBAL_THREADS_ONLY)
-#include <signal.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <thread.h>
-
-#include <sys/lwp.h>
-#include <sys/procfs.h>
-#include <sys/syscall.h>
-extern int syscall();  /* not declared in sys/syscall.h */
-
-static sigset_t old_mask;	/* store away original gc thread sigmask */
-static PRIntn gcprio;		/* store away original gc thread priority */
-
-THREAD_KEY_T threadid_key;
-THREAD_KEY_T cpuid_key;
-THREAD_KEY_T last_thread_key;
-static sigset_t set, oldset;
-
-static void
-threadid_key_destructor(void *value)
-{
-    PRThread *me = (PRThread *)value;
-    PR_ASSERT(me != NULL);
-    /* the thread could be PRIMORDIAL (thus not ATTACHED) */
-    if (me->flags & _PR_ATTACHED) {
-        /*
-         * The Solaris thread library sets the thread specific
-         * data (the current thread) to NULL before invoking
-         * the destructor.  We need to restore it to prevent the
-         * _PR_MD_CURRENT_THREAD() call in _PRI_DetachThread()
-         * from attaching the thread again.
-         */
-        _PR_MD_SET_CURRENT_THREAD(me);
-        _PRI_DetachThread();
-    }
-}
-
-void _MD_EarlyInit(void)
-{
-    THR_KEYCREATE(&threadid_key, threadid_key_destructor);
-    THR_KEYCREATE(&cpuid_key, NULL);
-    THR_KEYCREATE(&last_thread_key, NULL);
-    sigemptyset(&set);
-    sigaddset(&set, SIGALRM);
-}
-
-PRStatus _MD_CreateThread(PRThread *thread, 
-					void (*start)(void *), 
-					PRThreadPriority priority,
-					PRThreadScope scope, 
-					PRThreadState state, 
-					PRUint32 stackSize) 
-{
-	PRInt32 flags;
-	
-    /* mask out SIGALRM for native thread creation */
-    thr_sigsetmask(SIG_BLOCK, &set, &oldset); 
-
-    /*
-     * Note that we create joinable threads with the THR_DETACHED
-     * flag.  The reasons why we don't use thr_join to implement
-     * PR_JoinThread are:
-     * - We use a termination condition variable in the PRThread
-     *   structure to implement PR_JoinThread across all classic
-     *   nspr implementation strategies.
-     * - The native threads may be recycled by NSPR to run other
-     *   new NSPR threads, so the native threads may not terminate
-     *   when the corresponding NSPR threads terminate.  
-     */
-    flags = THR_SUSPENDED|THR_DETACHED;
-    if (_PR_IS_GCABLE_THREAD(thread) || (thread->flags & _PR_BOUND_THREAD) ||
-    							(scope == PR_GLOBAL_BOUND_THREAD))
-		flags |= THR_BOUND;
-
-    if (thr_create(NULL, thread->stack->stackSize,
-                  (void *(*)(void *)) start, (void *) thread, 
-				  flags,
-                  &thread->md.handle)) {
-        thr_sigsetmask(SIG_SETMASK, &oldset, NULL); 
-        return PR_FAILURE;
-    }
-
-    /* When the thread starts running, then the lwpid is set to the right
-     * value. Until then we want to mark this as 'uninit' so that
-     * its register state is initialized properly for GC */
-
-    thread->md.lwpid = -1;
-    thr_sigsetmask(SIG_SETMASK, &oldset, NULL); 
-    _MD_NEW_SEM(&thread->md.waiter_sem, 0);
-
-    if ((scope == PR_GLOBAL_THREAD) || (scope == PR_GLOBAL_BOUND_THREAD)) {
-		thread->flags |= _PR_GLOBAL_SCOPE;
-    }
-
-    _MD_SET_PRIORITY(&(thread->md), priority);
-
-    /* Activate the thread */
-    if (thr_continue( thread->md.handle ) ) {
-	return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}
-
-void _MD_cleanup_thread(PRThread *thread)
-{
-    thread_t hdl;
-
-    hdl = thread->md.handle;
-
-    /* 
-    ** First, suspend the thread (unless it's the active one)
-    ** Because we suspend it first, we don't have to use LOCK_SCHEDULER to
-    ** prevent both of us modifying the thread structure at the same time.
-    */
-    if ( thread != _PR_MD_CURRENT_THREAD() ) {
-        thr_suspend(hdl);
-    }
-    PR_LOG(_pr_thread_lm, PR_LOG_MIN,
-            ("(0X%x)[DestroyThread]\n", thread));
-
-    _MD_DESTROY_SEM(&thread->md.waiter_sem);
-}
-
-void _MD_exit_thread(PRThread *thread)
-{
-    _MD_CLEAN_THREAD(thread);
-    _MD_SET_CURRENT_THREAD(NULL);
-}
-
-void _MD_SET_PRIORITY(_MDThread *md_thread,
-        PRThreadPriority newPri)
-{
-	PRIntn nativePri;
-
-	if (newPri < PR_PRIORITY_FIRST) {
-		newPri = PR_PRIORITY_FIRST;
-	} else if (newPri > PR_PRIORITY_LAST) {
-		newPri = PR_PRIORITY_LAST;
-	}
-	/* Solaris priorities are from 0 to 127 */
-	nativePri = newPri * 127 / PR_PRIORITY_LAST;
-	if(thr_setprio((thread_t)md_thread->handle, nativePri)) {
-		PR_LOG(_pr_thread_lm, PR_LOG_MIN,
-		   ("_PR_SetThreadPriority: can't set thread priority\n"));
-	}
-}
-
-void _MD_WAIT_CV(
-    struct _MDCVar *md_cv, struct _MDLock *md_lock, PRIntervalTime timeout)
-{
-    struct timespec tt;
-    PRUint32 msec;
-    PRThread *me = _PR_MD_CURRENT_THREAD();
-
-	PR_ASSERT((!suspendAllOn) || (suspendAllThread != me));
-
-    if (PR_INTERVAL_NO_TIMEOUT == timeout) {
-        COND_WAIT(&md_cv->cv, &md_lock->lock);
-    } else {
-        msec = PR_IntervalToMilliseconds(timeout);
-
-        GETTIME(&tt);
-        tt.tv_sec += msec / PR_MSEC_PER_SEC;
-        tt.tv_nsec += (msec % PR_MSEC_PER_SEC) * PR_NSEC_PER_MSEC;
-        /* Check for nsec overflow - otherwise we'll get an EINVAL */
-        if (tt.tv_nsec >= PR_NSEC_PER_SEC) {
-            tt.tv_sec++;
-            tt.tv_nsec -= PR_NSEC_PER_SEC;
-        }
-        COND_TIMEDWAIT(&md_cv->cv, &md_lock->lock, &tt);
-    }
-}
-
-void _MD_lock(struct _MDLock *md_lock)
-{
-#ifdef DEBUG
-    /* This code was used for GC testing to make sure that we didn't attempt
-     * to grab any locks while threads are suspended.
-     */
-    PRLock *lock;
-    
-    if ((suspendAllOn) && (suspendAllThread == _PR_MD_CURRENT_THREAD())) {
-        lock = ((PRLock *) ((char*) (md_lock) - offsetof(PRLock,ilock)));
-	PR_ASSERT(lock->owner == NULL);
-        return;
-    }
-#endif /* DEBUG */
-
-    mutex_lock(&md_lock->lock);
-}
-
-PRThread *_pr_attached_thread_tls()
-{
-    PRThread *ret;
-
-    thr_getspecific(threadid_key, (void **)&ret);
-    return ret;
-}
-
-PRThread *_pr_current_thread_tls()
-{
-    PRThread *thread;
-
-    thread = _MD_GET_ATTACHED_THREAD();
-
-    if (NULL == thread) {
-        thread = _PRI_AttachThread(
-            PR_USER_THREAD, PR_PRIORITY_NORMAL, NULL, 0);
-    }
-    PR_ASSERT(thread != NULL);
-
-    return thread;
-}
-
-PRStatus
-_MD_wait(PRThread *thread, PRIntervalTime ticks)
-{
-        _MD_WAIT_SEM(&thread->md.waiter_sem);
-        return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WakeupWaiter(PRThread *thread)
-{
-	if (thread == NULL) {
-		return PR_SUCCESS;
-	}
-	_MD_POST_SEM(&thread->md.waiter_sem);
-	return PR_SUCCESS;
-}
-
-_PRCPU *_pr_current_cpu_tls()
-{
-    _PRCPU *ret;
-
-    thr_getspecific(cpuid_key, (void **)&ret);
-    return ret;
-}
-
-PRThread *_pr_last_thread_tls()
-{
-    PRThread *ret;
-
-    thr_getspecific(last_thread_key, (void **)&ret);
-    return ret;
-}
-
-_MDLock _pr_ioq_lock;
-
-void
-_MD_InitIO(void)
-{
-    _MD_NEW_LOCK(&_pr_ioq_lock);
-}
-
-PRStatus _MD_InitializeThread(PRThread *thread)
-{
-    if (!_PR_IS_NATIVE_THREAD(thread))
-        return PR_SUCCESS;
-    /* sol_curthread is an asm routine which grabs GR7; GR7 stores an internal
-     * thread structure ptr used by solaris.  We'll use this ptr later
-     * with suspend/resume to find which threads are running on LWPs.
-     */
-    thread->md.threadID = sol_curthread();
-		/* prime the sp; substract 4 so we don't hit the assert that
-		 * curr sp > base_stack
-		 */
-    thread->md.sp = (uint_t) thread->stack->allocBase - sizeof(long);
-    thread->md.lwpid = _lwp_self();
-    thread->md.handle = THR_SELF();
-
-	/* all threads on Solaris are global threads from NSPR's perspective
-	 * since all of them are mapped to Solaris threads.
-	 */
-    thread->flags |= _PR_GLOBAL_SCOPE;
- 
- 	/* For primordial/attached thread, we don't create an underlying native thread.
- 	 * So, _MD_CREATE_THREAD() does not get called.  We need to do initialization
- 	 * like allocating thread's synchronization variables and set the underlying
- 	 * native thread's priority.
- 	 */
-	if (thread->flags & (_PR_PRIMORDIAL | _PR_ATTACHED)) {
-	    _MD_NEW_SEM(&thread->md.waiter_sem, 0);
-	    _MD_SET_PRIORITY(&(thread->md), thread->priority);
-	}
-	return PR_SUCCESS;
-}
-
-/* Sleep for n milliseconds, n < 1000   */
-void solaris_msec_sleep(int n)
-{
-    struct timespec ts;
-
-    ts.tv_sec = 0;
-    ts.tv_nsec = 1000000*n;
-    if (syscall(SYS_nanosleep, &ts, 0, 0) < 0) {
-        PR_ASSERT(0);
-    }
-}      
-
-#define VALID_SP(sp, bottom, top)   \
-	(((uint_t)(sp)) > ((uint_t)(bottom)) && ((uint_t)(sp)) < ((uint_t)(top)))
-
-void solaris_record_regs(PRThread *t, prstatus_t *lwpstatus)
-{
-#ifdef sparc
-	long *regs = (long *)&t->md.context.uc_mcontext.gregs[0];
-
-	PR_ASSERT(_PR_IS_GCABLE_THREAD(t));
-	PR_ASSERT(t->md.threadID == lwpstatus->pr_reg[REG_G7]);
-
-	t->md.sp = lwpstatus->pr_reg[REG_SP];
-	PR_ASSERT(VALID_SP(t->md.sp, t->stack->stackBottom, t->stack->stackTop));
-
-	regs[0] = lwpstatus->pr_reg[R_G1];
-	regs[1] = lwpstatus->pr_reg[R_G2];
-	regs[2] = lwpstatus->pr_reg[R_G3];
-	regs[3] = lwpstatus->pr_reg[R_G4];
-	regs[4] = lwpstatus->pr_reg[R_O0];
-	regs[5] = lwpstatus->pr_reg[R_O1];
-	regs[6] = lwpstatus->pr_reg[R_O2];
-	regs[7] = lwpstatus->pr_reg[R_O3];
-	regs[8] = lwpstatus->pr_reg[R_O4];
-	regs[9] = lwpstatus->pr_reg[R_O5];
-	regs[10] = lwpstatus->pr_reg[R_O6];
-	regs[11] = lwpstatus->pr_reg[R_O7];
-#elif defined(i386)
-	/*
-	 * To be implemented and tested
-	 */
-	PR_ASSERT(0);
-	PR_ASSERT(t->md.threadID == lwpstatus->pr_reg[GS]);
-	t->md.sp = lwpstatus->pr_reg[UESP];
-#endif
-}   
-
-void solaris_preempt_off()
-{
-    sigset_t set;
- 
-    (void)sigfillset(&set);
-    syscall(SYS_sigprocmask, SIG_SETMASK, &set, &old_mask);
-}
-
-void solaris_preempt_on()
-{
-    syscall(SYS_sigprocmask, SIG_SETMASK, &old_mask, NULL);      
-}
-
-int solaris_open_main_proc_fd()
-{
-    char buf[30];
-    int fd;
-
-    /* Not locked, so must be created while threads coming up */
-    PR_snprintf(buf, sizeof(buf), "/proc/%ld", getpid());
-    if ( (fd = syscall(SYS_open, buf, O_RDONLY)) < 0) {
-        return -1;
-    }
-    return fd;
-}
-
-/* Return a file descriptor for the /proc entry corresponding to the
- * given lwp. 
- */
-int solaris_open_lwp(lwpid_t id, int lwp_main_proc_fd)
-{
-    int result;
-
-    if ( (result = syscall(SYS_ioctl, lwp_main_proc_fd, PIOCOPENLWP, &id)) <0)
-        return -1; /* exited??? */
-
-    return result;
-}
-void _MD_Begin_SuspendAll()
-{
-    solaris_preempt_off();
-
-    PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("Begin_SuspendAll\n"));
-    /* run at highest prio so I cannot be preempted */
-    thr_getprio(thr_self(), &gcprio);
-    thr_setprio(thr_self(), 0x7fffffff); 
-    suspendAllOn = PR_TRUE;
-    suspendAllThread = _PR_MD_CURRENT_THREAD();
-}
-
-void _MD_End_SuspendAll()
-{
-}
-
-void _MD_End_ResumeAll()
-{
-    PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ("End_ResumeAll\n"));
-    thr_setprio(thr_self(), gcprio);
-    solaris_preempt_on();
-    suspendAllThread = NULL;
-    suspendAllOn = PR_FALSE;
-}
-
-void _MD_Suspend(PRThread *thr)
-{
-   int lwp_fd, result;
-   prstatus_t lwpstatus;
-   int lwp_main_proc_fd = 0;
-  
-   if (!_PR_IS_GCABLE_THREAD(thr) || !suspendAllOn){
-     /*XXX When the suspendAllOn is set, we will be trying to do lwp_suspend
-      * during that time we can't call any thread lib or libc calls. Hence
-      * make sure that no suspension is requested for Non gcable thread
-      * during suspendAllOn */
-      PR_ASSERT(!suspendAllOn);
-      thr_suspend(thr->md.handle);
-      return;
-   }
-
-    /* XXX Primordial thread can't be bound to an lwp, hence there is no
-     * way we can assume that we can get the lwp status for primordial
-     * thread reliably. Hence we skip this for primordial thread, hoping
-     * that the SP is saved during lock and cond. wait. 
-     * XXX - Again this is concern only for java interpreter, not for the
-     * server, 'cause primordial thread in the server does not do java work
-     */
-    if (thr->flags & _PR_PRIMORDIAL)
-      return;
-    
-    /* XXX Important Note: If the start function of a thread is not called,
-     * lwpid is -1. Then, skip this thread. This thread will get caught
-     * in PR_NativeRunThread before calling the start function, because
-     * we hold the pr_activeLock during suspend/resume */
-
-    /* if the thread is not started yet then don't do anything */
-    if (!suspendAllOn || thr->md.lwpid == -1)
-      return;
-
-    if (_lwp_suspend(thr->md.lwpid) < 0) { 
-       PR_ASSERT(0);
-       return;
-    }
-
-    if ( (lwp_main_proc_fd = solaris_open_main_proc_fd()) < 0) {
-        PR_ASSERT(0);
-        return;   /* XXXMB ARGH, we're hosed! */
-    }
-
-   if ( (lwp_fd = solaris_open_lwp(thr->md.lwpid, lwp_main_proc_fd)) < 0) {
-           PR_ASSERT(0);
-           close(lwp_main_proc_fd);
-	   return;
-   }
-   if ( (result = syscall(SYS_ioctl, lwp_fd, PIOCSTATUS, &lwpstatus)) < 0) {
-            /* Hopefully the thread just died... */
-           close(lwp_fd);
-           close(lwp_main_proc_fd);
-	   return;
-   }
-            while ( !(lwpstatus.pr_flags & PR_STOPPED) ) {
-                if ( (result = syscall(SYS_ioctl, lwp_fd, PIOCSTATUS, &lwpstatus)) < 0) {
-                    PR_ASSERT(0);  /* ARGH SOMETHING WRONG! */
-                    break;
-                }
-                solaris_msec_sleep(1);
-            }
-            solaris_record_regs(thr, &lwpstatus);
-            close(lwp_fd);
-   close(lwp_main_proc_fd);
-}
-
-#ifdef USE_SETJMP
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-    if (isCurrent) {
-		(void) setjmp(CONTEXT(t));
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-}
-#else
-PRWord *_MD_HomeGCRegisters(PRThread *t, PRIntn isCurrent, PRIntn *np)
-{
-    if (isCurrent) {
-		(void) getcontext(CONTEXT(t));
-    }
-    *np = NGREG;
-    return (PRWord*) &t->md.context.uc_mcontext.gregs[0];
-}
-#endif  /* USE_SETJMP */
-
-#else /* _PR_GLOBAL_THREADS_ONLY */
-
-#if defined(_PR_LOCAL_THREADS_ONLY)
-
-void _MD_EarlyInit(void)
-{
-}
-
-void _MD_SolarisInit()
-{
-    _PR_UnixInit();
-}
-
-void
-_MD_SET_PRIORITY(_MDThread *thread, PRThreadPriority newPri)
-{
-    return;
-}
-
-PRStatus
-_MD_InitializeThread(PRThread *thread)
-{
-	return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
-{
-    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
-    _PR_MD_SWITCH_CONTEXT(thread);
-    return PR_SUCCESS;
-}
-
-PRStatus
-_MD_WAKEUP_WAITER(PRThread *thread)
-{
-	PR_ASSERT((thread == NULL) || (!(thread->flags & _PR_GLOBAL_SCOPE)));
-    return PR_SUCCESS;
-}
-
-/* These functions should not be called for Solaris */
-void
-_MD_YIELD(void)
-{
-    PR_NOT_REACHED("_MD_YIELD should not be called for Solaris");
-}
-
-PRStatus
-_MD_CREATE_THREAD(
-    PRThread *thread,
-    void (*start) (void *),
-    PRThreadPriority priority,
-    PRThreadScope scope,
-    PRThreadState state,
-    PRUint32 stackSize)
-{
-    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for Solaris");
-	return(PR_FAILURE);
-}
-
-#ifdef USE_SETJMP
-PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
-{
-    if (isCurrent) {
-		(void) setjmp(CONTEXT(t));
-    }
-    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
-    return (PRWord *) CONTEXT(t);
-}
-#else
-PRWord *_MD_HomeGCRegisters(PRThread *t, PRIntn isCurrent, PRIntn *np)
-{
-    if (isCurrent) {
-		(void) getcontext(CONTEXT(t));
-    }
-    *np = NGREG;
-    return (PRWord*) &t->md.context.uc_mcontext.gregs[0];
-}
-#endif  /* USE_SETJMP */
-
-#endif  /* _PR_LOCAL_THREADS_ONLY */
-
-#endif /* _PR_GLOBAL_THREADS_ONLY */
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/uxproces.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/uxproces.c	(revision 101809)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/uxproces.c	(revision 101810)
@@ -113,6 +113,5 @@
  */
 
-#if defined(_PR_GLOBAL_THREADS_ONLY) \
-	|| (defined(_PR_PTHREADS) && !defined(LINUX))
+#if defined(_PR_PTHREADS) && !defined(LINUX)
 #define _PR_NATIVE_THREADS
 #endif
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prenv.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prenv.c	(revision 101809)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prenv.c	(revision 101810)
@@ -45,11 +45,4 @@
 #define _PR_LOCK_ENV()
 #define _PR_UNLOCK_ENV()
-#elif defined(_PR_LOCAL_THREADS_ONLY)
-extern _PRCPU * _pr_primordialCPU;
-static PRIntn _is;
-#define _PR_NEW_LOCK_ENV()
-#define _PR_DELETE_LOCK_ENV()
-#define _PR_LOCK_ENV() if (_pr_primordialCPU) _PR_INTSOFF(_is);
-#define _PR_UNLOCK_ENV() if (_pr_primordialCPU) _PR_INTSON(_is);
 #else
 static PRLock *_pr_envLock = NULL;
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/threads/prcmon.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/threads/prcmon.c	(revision 101809)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/threads/prcmon.c	(revision 101810)
@@ -47,14 +47,8 @@
 #define _PR_UNLOCK_MCACHE()
 #else
-#ifdef _PR_LOCAL_THREADS_ONLY
-#define _PR_NEW_LOCK_MCACHE()
-#define _PR_LOCK_MCACHE() { PRIntn _is; _PR_INTSOFF(_is)
-#define _PR_UNLOCK_MCACHE() _PR_INTSON(_is); }
-#else
 PRLock *_pr_mcacheLock;
 #define _PR_NEW_LOCK_MCACHE() (_pr_mcacheLock = PR_NewLock())
 #define _PR_LOCK_MCACHE() PR_Lock(_pr_mcacheLock)
 #define _PR_UNLOCK_MCACHE() PR_Unlock(_pr_mcacheLock)
-#endif
 #endif
 
