Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bug 708813 - LDAP connection broken (application deadlocks) starting …

…with version 9. r=honza,a=Standard8 for checkin to Thunderbird/SeaMonkey specific relbranch

--HG--
branch : COMM100_2012012414_RELBRANCH
  • Loading branch information...
commit 8665353b980756592386252128f641611d8dedef 1 parent 101ef76
Brian Smith authored January 24, 2012
18  security/manager/ssl/src/PSMRunnable.cpp
@@ -46,14 +46,18 @@ SyncRunnableBase::SyncRunnableBase()
46 46
 nsresult
47 47
 SyncRunnableBase::DispatchToMainThreadAndWait()
48 48
 {
49  
-  NS_ASSERTION(!NS_IsMainThread(),
50  
-               "DispatchToMainThreadAndWait called on the main thread.");
51  
-
52  
-  mozilla::MonitorAutoLock lock(monitor);
53  
-  nsresult rv = NS_DispatchToMainThread(this);
54  
-  if (NS_SUCCEEDED(rv)) {
55  
-    lock.Wait();
  49
+  nsresult rv;
  50
+  if (NS_IsMainThread()) {
  51
+    RunOnTargetThread();
  52
+    rv = NS_OK;
  53
+  } else {
  54
+    mozilla::MonitorAutoLock lock(monitor);
  55
+    rv = NS_DispatchToMainThread(this);
  56
+    if (NS_SUCCEEDED(rv)) {
  57
+      lock.Wait();
  58
+    }
56 59
   }
  60
+
57 61
   return rv;
58 62
 }
59 63
 
6  security/manager/ssl/src/nsNSSCallbacks.cpp
@@ -825,11 +825,7 @@ PK11PasswordPrompt(PK11SlotInfo* slot, PRBool retry, void* arg)
825 825
   nsRefPtr<PK11PasswordPromptRunnable> runnable = 
826 826
     new PK11PasswordPromptRunnable(slot,
827 827
                                    static_cast<nsIInterfaceRequestor*>(arg));
828  
-  if (NS_IsMainThread()) {
829  
-    runnable->RunOnTargetThread();
830  
-  } else {
831  
-    runnable->DispatchToMainThreadAndWait();
832  
-  }
  828
+  runnable->DispatchToMainThreadAndWait();
833 829
   return runnable->mResult;
834 830
 }
835 831
 
5  security/manager/ssl/src/nsNSSIOLayer.cpp
@@ -827,11 +827,6 @@ void nsNSSSocketInfo::GetPreviousCert(nsIX509Cert** _result)
827 827
   NS_ASSERTION(_result, "_result parameter to GetPreviousCert is null");
828 828
   *_result = nsnull;
829 829
 
830  
-  if (NS_IsMainThread()) {
831  
-    NS_ERROR("nsNSSSocketInfo::GetPreviousCert called on the main thread");
832  
-    return;
833  
-  }
834  
-
835 830
   nsRefPtr<PreviousCertRunnable> runnable = new PreviousCertRunnable(mCallbacks);
836 831
   nsresult rv = runnable->DispatchToMainThreadAndWait();
837 832
   NS_ASSERTION(NS_SUCCEEDED(rv), "runnable->DispatchToMainThreadAndWait() failed");

0 notes on commit 8665353

Please sign in to comment.
Something went wrong with that request. Please try again.