changeset 9603:6d7b522079b5

threading: nit
author Steve Borho <steve@borho.org>
date Wed, 04 Mar 2015 08:28:48 -0600
parents 8cbb3771ae92
children affaf2561104
files source/common/threading.h
diffstat 1 files changed, 2 insertions(+-), 4 deletions(-) [+]
line wrap: on
line diff
--- a/source/common/threading.h	Fri Feb 27 15:14:20 2015 -0600
+++ b/source/common/threading.h	Wed Mar 04 08:28:48 2015 -0600
@@ -263,10 +263,8 @@ public:
 
         /* blocking wait on conditional variable, mutex is atomically released
          * while blocked. When condition is signaled, mutex is re-acquired */
-        while (m_counter == 0)
-        {
+        while (!m_counter)
             pthread_cond_wait(&m_cond, &m_mutex);
-        }
 
         m_counter--;
         pthread_mutex_unlock(&m_mutex);
@@ -277,7 +275,7 @@ public:
         bool bTimedOut = false;
 
         pthread_mutex_lock(&m_mutex);
-        if (m_counter == 0)
+        if (!m_counter)
         {
             struct timeval tv;
             struct timespec ts;