]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2332] changed the type of Locker::mutex_ to a reference.
authorJINMEI Tatuya <jinmei@isc.org>
Mon, 15 Oct 2012 18:21:47 +0000 (11:21 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Mon, 15 Oct 2012 18:21:47 +0000 (11:21 -0700)
may not be a big deal in such a simple case, but just as suggested in review.

src/lib/util/threads/lock.h

index 8a072f10d3ddba7739c343fcc7afdc2ed0737936..16b386fb7d3d0d50d816864f6273c33b49ea74e7 100644 (file)
@@ -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
     ///