Commit 671005ee authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[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.
parent b6d2a03f
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
/// means an attempt to use the mutex in a wrong way (locking /// means an attempt to use the mutex in a wrong way (locking
/// a mutex second time from the same thread, for example). /// a mutex second time from the same thread, for example).
Locker(Mutex& mutex) : Locker(Mutex& mutex) :
mutex_(&mutex) mutex_(mutex)
{ {
mutex.lock(); mutex.lock();
} }
...@@ -94,10 +94,10 @@ public: ...@@ -94,10 +94,10 @@ public:
/// ///
/// Unlocks the mutex. /// Unlocks the mutex.
~Locker() { ~Locker() {
mutex_->unlock(); mutex_.unlock();
} }
private: private:
Mutex* const mutex_; Mutex& mutex_;
}; };
/// \brief If the mutex is currently locked /// \brief If the mutex is currently locked
/// ///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment