Re: firefox-3.6.8
On Thu, Aug 12, 2010 at 10:22:41AM -0500, Bob Tracy wrote:
> The "few intermediate functions" (in case they're significant in this
> context) are:
>
> CallGetService()
> nsGetServiceByCIDWithError::operator()()
> nsCOMPtr_base::assign_from_gs_cid_with_error()
> nsCOMPtr<nsIProxyObjectManager>::nsCOMPtr()
> NS_GetProxyForObject()
They were... Some "impactful" (yet minor looking) changes were made to
"xpcom/glue/nsThreadUtils.[cpp,h]". Replacing the 3.5.5 versions of
these two files with their 3.5.4 counterparts and rebuilding yielded a
functional 3.5.5. The diffs between 3.5.4 and 3.5.5 are attached.
Gettin' brave, now :-). Let's try 3.5.11 (assuming those two files
weren't touched after 3.5.5, but I'll find out soon enough).
--Bob
--- nsThreadUtils.cpp 2010-08-12 10:33:20.000000000 -0500
+++ nsThreadUtils_355.cpp 2009-11-02 15:43:22.000000000 -0600
@@ -116,20 +116,29 @@
#endif
}
-NS_METHOD_(PRBool)
-NS_IsMainThread()
+#ifndef MOZILLA_INTERNAL_API
+bool NS_IsMainThread()
{
PRBool result = PR_FALSE;
-#ifdef MOZILLA_INTERNAL_API
- nsThreadManager::get()->nsThreadManager::GetIsMainThread(&result);
-#else
nsCOMPtr<nsIThreadManager> mgr =
- do_GetService(NS_THREADMANAGER_CONTRACTID);
+ do_GetService(NS_THREADMANAGER_CONTRACTID);
if (mgr)
mgr->GetIsMainThread(&result);
-#endif
- return result;
+ return bool(result);
}
+#elif !defined(NS_TLS)
+bool NS_IsMainThread()
+{
+ PRBool result = PR_FALSE;
+ nsThreadManager::get()->nsThreadManager::GetIsMainThread(&result);
+ return bool(result);
+}
+#elif !defined(MOZ_ENABLE_LIBXUL)
+bool NS_IsMainThread()
+{
+ return gTLSIsMainThread;
+}
+#endif
NS_METHOD
NS_DispatchToCurrentThread(nsIRunnable *event)
--- nsThreadUtils.h 2010-08-12 10:42:27.000000000 -0500
+++ nsThreadUtils_355.h 2009-11-02 15:43:22.000000000 -0600
@@ -98,14 +98,28 @@
extern NS_COM_GLUE NS_METHOD
NS_GetMainThread(nsIThread **result);
+#if defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
+// This is defined in nsThreadManager.cpp and initialized to `true` for the
+// main thread by nsThreadManager::Init.
+extern NS_TLS bool gTLSIsMainThread;
+
+#ifdef MOZ_ENABLE_LIBXUL
+inline bool NS_IsMainThread()
+{
+ return gTLSIsMainThread;
+}
+#else
+NS_COM bool NS_IsMainThread();
+#endif
+#else
/**
* Test to see if the current thread is the main thread.
*
* @returns PR_TRUE if the current thread is the main thread, and PR_FALSE
* otherwise.
*/
-extern NS_COM_GLUE NS_METHOD_(PRBool)
-NS_IsMainThread();
+extern NS_COM_GLUE bool NS_IsMainThread();
+#endif
/**
* Dispatch the given event to the current thread.
Reply to: