From 2cd2169849a893d76a1915895f797cae01ca8484 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Wed, 5 Mar 2003 23:30:22 +0000 Subject: [PATCH] removing NS_MT_SUPPORTED define. b=186494, r=dougt, r=seawood --- config/config.mak | 3 --- configure.in | 4 ---- js/src/xpconnect/src/XPCDispPrivate.h | 4 ---- xpcom/base/nsISupportsObsolete.h | 12 ------------ xpcom/base/nsTraceRefcnt.cpp | 8 -------- xpcom/base/nsTraceRefcntImpl.cpp | 8 -------- xpcom/glue/nsDebug.cpp | 4 ++-- xpcom/glue/nsISupportsImpl.h | 24 +++--------------------- 8 files changed, 5 insertions(+), 62 deletions(-) diff --git a/config/config.mak b/config/config.mak index c31af14ec5d..a17123d0a2f 100644 --- a/config/config.mak +++ b/config/config.mak @@ -236,9 +236,6 @@ MOZ_TRACE_MALLOC=1 !endif -# For modular netlib support. -CFLAGS=$(CFLAGS) -DNS_MT_SUPPORTED -DNETLIB_THREAD -DNS_NET_FILE - # Defines for cookie management feature... CFLAGS=$(CFLAGS) -DCookieManagement diff --git a/configure.in b/configure.in index 53fc7aa16f9..2c1464ed01e 100644 --- a/configure.in +++ b/configure.in @@ -4583,10 +4583,6 @@ if test "$MOZ_LDAP_XPCOM"; then fi fi -dnl make sure that we compile in multi-processor support -NS_MT_SUPPORTED=1 -AC_DEFINE(NS_MT_SUPPORTED) - if test "$SUNCTL"; then dnl older versions of glib do not seem to have gmodule which ctl needs _SAVE_CFLAGS=$CFLAGS diff --git a/js/src/xpconnect/src/XPCDispPrivate.h b/js/src/xpconnect/src/XPCDispPrivate.h index f49e60eb79e..6656a386ab7 100644 --- a/js/src/xpconnect/src/XPCDispPrivate.h +++ b/js/src/xpconnect/src/XPCDispPrivate.h @@ -137,10 +137,6 @@ STDMETHODIMP_(ULONG) _class::Release(void) \ return mRefCnt; \ } -#ifndef NS_MT_SUPPORTED -#error "We need MT support -#endif - extern const nsID NSID_IDISPATCH; /** diff --git a/xpcom/base/nsISupportsObsolete.h b/xpcom/base/nsISupportsObsolete.h index abfd56a4e0a..6ddc8febe0a 100644 --- a/xpcom/base/nsISupportsObsolete.h +++ b/xpcom/base/nsISupportsObsolete.h @@ -37,9 +37,7 @@ #ifndef nsISupportsObsolete_h__ #define nsISupportsObsolete_h__ -#if defined(NS_MT_SUPPORTED) #include "prcmon.h" -#endif /* NS_MT_SUPPORTED */ /////////////////////////////////////////////////////////////////////////////// @@ -258,21 +256,11 @@ NS_IMPL_SETTER_STR(_class::Set##_postfix, _member) { 0x88210890, 0x47a6, 0x11d2, \ {0xbe, 0xc3, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc} } - -#if defined(NS_MT_SUPPORTED) - #define NS_LOCK_INSTANCE() \ PR_CEnterMonitor((void*)this) #define NS_UNLOCK_INSTANCE() \ PR_CExitMonitor((void*)this) -#else - -#define NS_LOCK_INSTANCE() -#define NS_UNLOCK_INSTANCE() - -#endif - /** * This implements query interface with two assumptions: First, the * class in question implements nsISupports and its own interface and diff --git a/xpcom/base/nsTraceRefcnt.cpp b/xpcom/base/nsTraceRefcnt.cpp index ebb7fe171f0..dbcb60e9ebb 100644 --- a/xpcom/base/nsTraceRefcnt.cpp +++ b/xpcom/base/nsTraceRefcnt.cpp @@ -99,17 +99,12 @@ NS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues, #include "plhash.h" #include "prmem.h" -#if defined(NS_MT_SUPPORTED) #include "prlock.h" static PRLock* gTraceLock; #define LOCK_TRACELOG() PR_Lock(gTraceLock) #define UNLOCK_TRACELOG() PR_Unlock(gTraceLock) -#else /* ! NT_MT_SUPPORTED */ -#define LOCK_TRACELOG() -#define UNLOCK_TRACELOG() -#endif /* ! NS_MT_SUPPORTED */ static PLHashTable* gBloatView; static PLHashTable* gTypesToLog; @@ -843,10 +838,7 @@ static void InitTraceLog(void) gLogging = PR_TRUE; } -#if defined(NS_MT_SUPPORTED) gTraceLock = PR_NewLock(); -#endif /* NS_MT_SUPPORTED */ - } #endif diff --git a/xpcom/base/nsTraceRefcntImpl.cpp b/xpcom/base/nsTraceRefcntImpl.cpp index ebb7fe171f0..dbcb60e9ebb 100644 --- a/xpcom/base/nsTraceRefcntImpl.cpp +++ b/xpcom/base/nsTraceRefcntImpl.cpp @@ -99,17 +99,12 @@ NS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues, #include "plhash.h" #include "prmem.h" -#if defined(NS_MT_SUPPORTED) #include "prlock.h" static PRLock* gTraceLock; #define LOCK_TRACELOG() PR_Lock(gTraceLock) #define UNLOCK_TRACELOG() PR_Unlock(gTraceLock) -#else /* ! NT_MT_SUPPORTED */ -#define LOCK_TRACELOG() -#define UNLOCK_TRACELOG() -#endif /* ! NS_MT_SUPPORTED */ static PLHashTable* gBloatView; static PLHashTable* gTypesToLog; @@ -843,10 +838,7 @@ static void InitTraceLog(void) gLogging = PR_TRUE; } -#if defined(NS_MT_SUPPORTED) gTraceLock = PR_NewLock(); -#endif /* NS_MT_SUPPORTED */ - } #endif diff --git a/xpcom/glue/nsDebug.cpp b/xpcom/glue/nsDebug.cpp index 746d5ee8fbc..d11df01db0f 100644 --- a/xpcom/glue/nsDebug.cpp +++ b/xpcom/glue/nsDebug.cpp @@ -492,7 +492,7 @@ NS_ErrorAccordingToNSPR() // This wrapper around PR_GetCurrentThread is simply here for debug builds so // that clients linking with xpcom don't also have to link with nspr explicitly. -#if defined(NS_DEBUG) && defined(NS_MT_SUPPORTED) +#if defined(NS_DEBUG) #include "nsISupportsUtils.h" #include "prthread.h" @@ -534,6 +534,6 @@ NS_CheckThreadSafe(void* owningThread, const char* msg) } } -#endif // !(defined(NS_DEBUG) && defined(NS_MT_SUPPORTED)) +#endif // !(defined(NS_DEBUG) //////////////////////////////////////////////////////////////////////////////// diff --git a/xpcom/glue/nsISupportsImpl.h b/xpcom/glue/nsISupportsImpl.h index ccf0e618474..793ca514109 100644 --- a/xpcom/glue/nsISupportsImpl.h +++ b/xpcom/glue/nsISupportsImpl.h @@ -65,7 +65,7 @@ //////////////////////////////////////////////////////////////////////////////// // Macros to help detect thread-safety: -#if defined(NS_DEBUG) && defined(NS_MT_SUPPORTED) && !defined(XPCOM_GLUE) +#if defined(NS_DEBUG) && !defined(XPCOM_GLUE) extern "C" NS_COM void* NS_CurrentThread(void); extern "C" NS_COM void NS_CheckThreadSafe(void* owningThread, @@ -84,12 +84,12 @@ private: #define NS_ASSERT_OWNINGTHREAD(_class) \ NS_CheckThreadSafe(_mOwningThread.GetThread(), #_class " not thread-safe") -#else // !(defined(NS_DEBUG) && defined(NS_MT_SUPPORTED)) +#else // !(defined(NS_DEBUG)) #define NS_DECL_OWNINGTHREAD /* nothing */ #define NS_ASSERT_OWNINGTHREAD(_class) ((void)0) -#endif // !(defined(NS_DEBUG) && defined(NS_MT_SUPPORTED)) +#endif // !(defined(NS_DEBUG)) class nsAutoRefCnt { @@ -696,8 +696,6 @@ NS_IMETHODIMP_(nsrefcnt) Class::Release(void) \ * */ -#if defined(NS_MT_SUPPORTED) - /** * Use this macro to implement the AddRef method for a given _class * @param _class The name of the class implementing the method @@ -735,22 +733,6 @@ NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \ return count; \ } -#else // defined(NS_MT_SUPPORTED) - -/** - * Convenience macro for implementing all nsISupports methods for - * a simple class. - * @param _class The name of the class implementing the method - * @param _classiiddef The name of the #define symbol that defines the IID - * for the class (e.g. NS_ISUPPORTS_IID) - */ - -#define NS_IMPL_THREADSAFE_ADDREF(_class) NS_IMPL_ADDREF(_class) - -#define NS_IMPL_THREADSAFE_RELEASE(_class) NS_IMPL_RELEASE(_class) - -#endif /* !NS_MT_SUPPORTED */ - #define NS_IMPL_THREADSAFE_ISUPPORTS0(_class) \ NS_IMPL_THREADSAFE_ADDREF(_class) \ NS_IMPL_THREADSAFE_RELEASE(_class) \