Bug 696030 - Use MonitorAutoLock rather than MonitorAutoEnter in nsGIOProtocolHandler r=karlt
authorChris Coulson <chris.coulson@canonical.com>
Thu, 05 Jan 2012 11:19:50 +1300
changeset 85060 21c2b8c54c54ed4c110d500e7934d2a0316e9b11
parent 85059 04244dc1f49853dfff572a8b8664cd52135c1ca3
child 85061 44d3202f73e0b37ee1aa60d0cb0bc782d32b57c7
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs696030
milestone12.0a1
Bug 696030 - Use MonitorAutoLock rather than MonitorAutoEnter in nsGIOProtocolHandler r=karlt
extensions/gio/nsGIOProtocolHandler.cpp
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -233,17 +233,17 @@ class nsGIOInputStream : public nsIInput
  * Set result of mount operation and notify monitor waiting for results.
  * This method is called in main thread as long as it is used only 
  * in mount_enclosing_volume_finished function.
  * @param result Result of mount operation
  */ 
 void
 nsGIOInputStream::SetMountResult(MountOperationResult result, gint error_code)
 {
-  mozilla::MonitorAutoEnter mon(mMonitorMountInProgress);
+  mozilla::MonitorAutoLock mon(mMonitorMountInProgress);
   mMountRes = result;
   mMountErrorCode = error_code;
   mon.Notify();
 }
 
 /**
  * Start mount operation and wait in loop until it is finished. This method is 
  * called from thread which is trying to read from location.
@@ -258,17 +258,17 @@ nsGIOInputStream::MountVolume() {
      Callback mount_enclosing_volume_finished is called in main thread 
      (not this thread on which this method is called). */
   g_file_mount_enclosing_volume(mHandle,
                                 G_MOUNT_MOUNT_NONE,
                                 mount_op,
                                 NULL,
                                 mount_enclosing_volume_finished,
                                 this);
-  mozilla::MonitorAutoEnter mon(mMonitorMountInProgress);
+  mozilla::MonitorAutoLock mon(mMonitorMountInProgress);
   /* Waiting for finish of mount operation thread */  
   while (mMountRes == MOUNT_OPERATION_IN_PROGRESS)
     mon.Wait();
   
   g_object_unref(mount_op);
 
   if (mMountRes == MOUNT_OPERATION_FAILED) {
     return MapGIOResult(mMountErrorCode);