]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/unix/semaphore.cpp
Use nullptr instead of 0 for pointers
[libs/core.git] / source / core / unix / semaphore.cpp
index 81492585a52636d55f3934f07fa5e1da1c5a1ce1..f19bdab92d4da8c6ad636a8e7c796c6234f889fe 100644 (file)
@@ -14,17 +14,16 @@ struct Semaphore::Private
 {
        Mutex mutex;
        pthread_cond_t cond;
-       unsigned limit;
-       unsigned count;
+       unsigned limit = 1;
+       unsigned count = 0;
 };
 
 
 Semaphore::Semaphore(unsigned limit):
        priv(new Private)
 {
-       pthread_cond_init(&priv->cond, 0);
+       pthread_cond_init(&priv->cond, nullptr);
        priv->limit = limit;
-       priv->count = 0;
 }
 
 Semaphore::~Semaphore()