Bug 505718 - 'mochitest-plain timeout (hanging?) during shutdown on Windows'. Adding a comment to make the fix clearer.
authorBen Turner <bent.mozilla@gmail.com>
Wed, 12 Aug 2009 21:42:09 -0700
changeset 31417 e53964cf3d2099eee4a5a78e474f28410765c189
parent 31416 2113cb711b0957deb8b8223122e01fa91faba259
child 31418 58f91861b1f15eda8ebc700f38dda791ea1741aa
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
bugs505718
milestone1.9.2a2pre
Bug 505718 - 'mochitest-plain timeout (hanging?) during shutdown on Windows'. Adding a comment to make the fix clearer.
dom/src/threads/nsDOMThreadService.cpp
--- a/dom/src/threads/nsDOMThreadService.cpp
+++ b/dom/src/threads/nsDOMThreadService.cpp
@@ -550,17 +550,19 @@ DOMWorkerOperationCallback(JSContext* aC
 
       // Only do all this setup once.
       wasSuspended = PR_TRUE;
     }
 
     nsAutoMonitor mon(worker->Pool()->Monitor());
 
     // There's a small chance that the worker was canceled after our check
-    // above in which case we shouldn't wait here.
+    // above in which case we shouldn't wait here. We're guaranteed not to race
+    // here because the pool reenters its monitor after canceling each worker
+    // in order to notify its condition variable.
     if (!worker->IsCanceled()) {
       mon.Wait();
     }
   }
 
   NS_NOTREACHED("Should never get here!");
   return JS_FALSE;
 }