Bug 828630 - Fix data race on nsSocketTransportService::mOffline. r=mcmanus, a=akeybl
authorJosh Aas <joshmoz@gmail.com>
Fri, 11 Jan 2013 11:57:24 -0500
changeset 127117 ad6a01269c341c48733ed0e58d65efe8ab569acf
parent 127116 150577f90962e36cb8d4ae25e86194b871a287dd
child 127118 83ab7d93d8998a563488445ddc6c54c462d7449d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, akeybl
bugs828630
milestone20.0a2
Bug 828630 - Fix data race on nsSocketTransportService::mOffline. r=mcmanus, a=akeybl
netwerk/base/src/nsSocketTransportService2.cpp
--- a/netwerk/base/src/nsSocketTransportService2.cpp
+++ b/netwerk/base/src/nsSocketTransportService2.cpp
@@ -526,16 +526,17 @@ nsSocketTransportService::GetOffline(boo
 {
     *offline = mOffline;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSocketTransportService::SetOffline(bool offline)
 {
+    MutexAutoLock lock(mLock);
     if (!mOffline && offline) {
         // signal the socket thread to go offline, so it will detach sockets
         mGoingOffline = true;
         mOffline = true;
     }
     else if (mOffline && !offline) {
         mOffline = false;
     }