]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/unix/semaphore.cpp
Use default member initializers and constructor delegation
[libs/core.git] / source / core / unix / semaphore.cpp
index 81492585a52636d55f3934f07fa5e1da1c5a1ce1..6a4bacf9defddb911244ba44ced8fd82121e6d97 100644 (file)
@@ -14,8 +14,8 @@ struct Semaphore::Private
 {
        Mutex mutex;
        pthread_cond_t cond;
-       unsigned limit;
-       unsigned count;
+       unsigned limit = 1;
+       unsigned count = 0;
 };
 
 
@@ -24,7 +24,6 @@ Semaphore::Semaphore(unsigned limit):
 {
        pthread_cond_init(&priv->cond, 0);
        priv->limit = limit;
-       priv->count = 0;
 }
 
 Semaphore::~Semaphore()