From: JINMEI Tatuya Date: Mon, 15 Oct 2012 18:21:47 +0000 (-0700) Subject: [2332] changed the type of Locker::mutex_ to a reference. X-Git-Tag: trac2402_base~19^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=671005eea2c18ad34bb0bad435b538447cdc7a50;p=thirdparty%2Fkea.git [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. --- diff --git a/src/lib/util/threads/lock.h b/src/lib/util/threads/lock.h index 8a072f10d3..16b386fb7d 100644 --- a/src/lib/util/threads/lock.h +++ b/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 ///