]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/mutex.h
Style updates
[libs/core.git] / source / core / mutex.h
index 50a64e55aaa0a87a1a6d114960ed5cd3416e5527..c0c26829630b9dee55bdabf885fd76a6a87ca4f5 100644 (file)
@@ -28,7 +28,7 @@ public:
        int unlock()  { return pthread_mutex_unlock(&mutex); }
        ~Mutex()      { pthread_mutex_destroy(&mutex); }
 #else
        int unlock()  { return pthread_mutex_unlock(&mutex); }
        ~Mutex()      { pthread_mutex_destroy(&mutex); }
 #else
-       Mutex()       { mutex=CreateMutex(0, false, 0); }
+       Mutex()       { mutex = CreateMutex(0, false, 0); }
        int lock()    { return WaitForSingleObject(mutex, INFINITE)==WAIT_OBJECT_0; }
        int trylock() { return WaitForSingleObject(mutex, 0)==WAIT_OBJECT_0; }
        int unlock()  { return !ReleaseMutex(mutex); }
        int lock()    { return WaitForSingleObject(mutex, INFINITE)==WAIT_OBJECT_0; }
        int trylock() { return WaitForSingleObject(mutex, 0)==WAIT_OBJECT_0; }
        int unlock()  { return !ReleaseMutex(mutex); }
@@ -45,7 +45,7 @@ private:
        Mutex &mutex;
 
 public:
        Mutex &mutex;
 
 public:
-       MutexLock(Mutex &m, bool l=true): mutex(m) { if(l) mutex.lock(); }
+       MutexLock(Mutex &m, bool l = true): mutex(m) { if(l) mutex.lock(); }
        ~MutexLock() { mutex.unlock(); }
 
        int lock() { return mutex.lock(); }
        ~MutexLock() { mutex.unlock(); }
 
        int lock() { return mutex.lock(); }
@@ -66,7 +66,7 @@ public:
 
        T &operator*() const { return *data; }
        T *operator->() const { return data; }
 
        T &operator*() const { return *data; }
        T *operator->() const { return data; }
-       void clear() { mutex=0; data=0; }
+       void clear() { mutex=0; data = 0; }
 private:
        RefPtr<MutexLock> mutex;
        T *data;
 private:
        RefPtr<MutexLock> mutex;
        T *data;
@@ -80,7 +80,7 @@ public:
        MutexPtr(const MutexPtr<T> &p): RefCount(p), mutex(p.mutex), data(p.data) { }
        T &operator*() const { return *data; }
        T *operator->() const { return data; }
        MutexPtr(const MutexPtr<T> &p): RefCount(p), mutex(p.mutex), data(p.data) { }
        T &operator*() const { return *data; }
        T *operator->() const { return data; }
-       void clear() { decref(); data=0; }
+       void clear() { decref(); data = 0; }
        ~MutexPtr() { decref(); }
 protected:
        Mutex &mutex;
        ~MutexPtr() { decref(); }
 protected:
        Mutex &mutex;