Thrift: standardize coding style
Summary: Standardize indentation, spacing, #defines etc.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664784 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/Mutex.cc b/lib/cpp/src/concurrency/Mutex.cc
index 8282e73..416341e 100644
--- a/lib/cpp/src/concurrency/Mutex.cc
+++ b/lib/cpp/src/concurrency/Mutex.cc
@@ -3,41 +3,42 @@
#include <assert.h>
#include <pthread.h>
-/** Implementation of Mutex class using POSIX mutex
-
- @author marc
- @version $Id:$ */
-
namespace facebook { namespace thrift { namespace concurrency {
+/**
+ * Implementation of Mutex class using POSIX mutex
+ *
+ * @author marc
+ * @version $Id:$
+ */
class Mutex::impl {
-public:
+ public:
impl() : initialized(false) {
assert(pthread_mutex_init(&_pthread_mutex, NULL) == 0);
initialized = true;
}
~impl() {
- if(initialized) {
+ if (initialized) {
initialized = false;
assert(pthread_mutex_destroy(&_pthread_mutex) == 0);
}
}
- void lock() const {pthread_mutex_lock(&_pthread_mutex);}
+ void lock() const { pthread_mutex_lock(&_pthread_mutex); }
- void unlock() const {pthread_mutex_unlock(&_pthread_mutex);}
+ void unlock() const { pthread_mutex_unlock(&_pthread_mutex); }
-private:
+ private:
mutable pthread_mutex_t _pthread_mutex;
mutable bool initialized;
};
Mutex::Mutex() : _impl(new Mutex::impl()) {}
-void Mutex::lock() const {_impl->lock();}
+void Mutex::lock() const { _impl->lock(); }
-void Mutex::unlock() const {_impl->unlock();}
+void Mutex::unlock() const { _impl->unlock(); }
}}} // facebook::thrift::concurrency