Browse Source

[2332] changed the type of Locker::mutex_ to a reference.

may not be a big deal in such a simple case, but just as suggested in review.
JINMEI Tatuya 12 years ago
parent
commit
671005eea2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/lib/util/threads/lock.h

+ 3 - 3
src/lib/util/threads/lock.h

@@ -85,7 +85,7 @@ public:
         ///     means an attempt to use the mutex in a wrong way (locking
         ///     a mutex second time from the same thread, for example).
         Locker(Mutex& mutex) :
-            mutex_(&mutex)
+            mutex_(mutex)
         {
             mutex.lock();
         }
@@ -94,10 +94,10 @@ public:
         ///
         /// Unlocks the mutex.
         ~Locker() {
-            mutex_->unlock();
+            mutex_.unlock();
         }
     private:
-        Mutex* const mutex_;
+        Mutex& mutex_;
     };
     /// \brief If the mutex is currently locked
     ///