]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2202] Cleanup: use better variable name
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 26 Sep 2012 09:20:40 +0000 (11:20 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 26 Sep 2012 09:20:40 +0000 (11:20 +0200)
The previous looked like it should be boolean (there's something good
about lisp's P suffix).

src/lib/util/threads/lock.cc

index f15052e0035a7113f29a8cb655cb58b93f42519c..7c34baa56dd7724fc348a5fd480e5e47108400c1 100644 (file)
@@ -32,11 +32,11 @@ namespace thread {
 class Mutex::Impl {
 public:
     Impl() :
-        locked(0)
+        locked_count(0)
     {}
     pthread_mutex_t mutex;
     // Only in debug mode
-    size_t locked;
+    size_t locked_count;
 };
 
 namespace {
@@ -99,7 +99,7 @@ Mutex::Mutex(bool recursive) :
 Mutex::~Mutex() {
     if (impl_ != NULL) {
         const int result = pthread_mutex_destroy(&impl_->mutex);
-        const bool locked = impl_->locked != 0;
+        const bool locked = impl_->locked_count != 0;
         delete impl_;
         if (result != 0) {
             // Yes, really throwing from the destructor.
@@ -121,13 +121,13 @@ Mutex::lock() {
     if (result != 0) {
         isc_throw(isc::InvalidOperation, strerror(result));
     }
-    ++impl_->locked; // Only in debug mode
+    ++impl_->locked_count; // Only in debug mode
 }
 
 void
 Mutex::unlock() {
     assert(impl_ != NULL);
-    --impl_->locked; // Only in debug mode
+    --impl_->locked_count; // Only in debug mode
     const int result = pthread_mutex_unlock(&impl_->mutex);
     if (result != 0) {
         isc_throw(isc::InvalidOperation, strerror(result));
@@ -137,7 +137,7 @@ Mutex::unlock() {
 // TODO: Disable in non-debug build
 bool
 Mutex::locked() const {
-    return (impl_->locked != 0);
+    return (impl_->locked_count != 0);
 }
 
 }