diff --git a/lib/cpp/src/concurrency/Monitor.cpp b/lib/cpp/src/concurrency/Monitor.cpp
index 0177a0c..8517c03 100644
--- a/lib/cpp/src/concurrency/Monitor.cpp
+++ b/lib/cpp/src/concurrency/Monitor.cpp
@@ -31,15 +31,15 @@
     mutexInitialized_(false),
     condInitialized_(false) {
 
-    if(pthread_mutex_init(&pthread_mutex_, NULL) == 0) {
+    if (pthread_mutex_init(&pthread_mutex_, NULL) == 0) {
       mutexInitialized_ = true;
 
-      if(pthread_cond_init(&pthread_cond_, NULL) == 0) {
+      if (pthread_cond_init(&pthread_cond_, NULL) == 0) {
         condInitialized_ = true;
       }
     }
 
-    if(!mutexInitialized_ || !condInitialized_) {
+    if (!mutexInitialized_ || !condInitialized_) {
       cleanup();
       throw SystemResourceException();
     }
@@ -66,7 +66,7 @@
                                           &pthread_mutex_,
                                           &abstime);
       if (result == ETIMEDOUT) {
-	assert(Util::currentTime() >= (now + timeout));
+        assert(Util::currentTime() >= (now + timeout));
         throw TimedOutException();
       }
     }
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
index e433467..5f86ea2 100644
--- a/lib/cpp/src/concurrency/PosixThreadFactory.cpp
+++ b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
@@ -69,38 +69,38 @@
     state_ = starting;
 
     pthread_attr_t thread_attr;
-    if(pthread_attr_init(&thread_attr) != 0) {
+    if (pthread_attr_init(&thread_attr) != 0) {
         throw SystemResourceException("pthread_attr_init failed");
     }
 
-    if(pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE) != 0) {
-        throw SystemResourceException("pthread_attr_setdetachstate failed");
+    if (pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE) != 0) {
+      throw SystemResourceException("pthread_attr_setdetachstate failed");
     }
 
     // Set thread stack size
-    if(pthread_attr_setstacksize(&thread_attr, MB * stackSize_) != 0) {
-        throw SystemResourceException("pthread_attr_setstacksize failed");
+    if (pthread_attr_setstacksize(&thread_attr, MB * stackSize_) != 0) {
+      throw SystemResourceException("pthread_attr_setstacksize failed");
     }
 
     // Set thread policy
-    if(pthread_attr_setschedpolicy(&thread_attr, policy_) != 0) {
-        throw SystemResourceException("pthread_attr_setschedpolicy failed");
+    if (pthread_attr_setschedpolicy(&thread_attr, policy_) != 0) {
+      throw SystemResourceException("pthread_attr_setschedpolicy failed");
     }
 
     struct sched_param sched_param;
     sched_param.sched_priority = priority_;
 
     // Set thread priority
-    if(pthread_attr_setschedparam(&thread_attr, &sched_param) != 0) {
-        throw SystemResourceException("pthread_attr_setschedparam failed");
+    if (pthread_attr_setschedparam(&thread_attr, &sched_param) != 0) {
+      throw SystemResourceException("pthread_attr_setschedparam failed");
     }
 
     // Create reference
     shared_ptr<PthreadThread>* selfRef = new shared_ptr<PthreadThread>();
     *selfRef = self_.lock();
 
-    if(pthread_create(&pthread_, &thread_attr, threadMain, (void*)selfRef) != 0) {
-        throw SystemResourceException("pthread_create failed");
+    if (pthread_create(&pthread_, &thread_attr, threadMain, (void*)selfRef) != 0) {
+      throw SystemResourceException("pthread_create failed");
     }
   }
 
@@ -223,7 +223,7 @@
 
   PRIORITY priority() const { return priority_; }
 
-  Thread::id_t currentThreadId() const {return pthread_self();}
+  Thread::id_t currentThreadId() const { return pthread_self(); }
 
   /**
    * Sets priority.
@@ -247,6 +247,6 @@
 
 void PosixThreadFactory::priority(PosixThreadFactory::PRIORITY value) { impl_->priority(value); }
 
-Thread::id_t PosixThreadFactory::currentThreadId() const {return impl_->currentThreadId();}
+Thread::id_t PosixThreadFactory::currentThreadId() const { return impl_->currentThreadId(); }
 
 }}} // facebook::thrift::concurrency
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.h b/lib/cpp/src/concurrency/PosixThreadFactory.h
index 4e31dc5..5f032c1 100644
--- a/lib/cpp/src/concurrency/PosixThreadFactory.h
+++ b/lib/cpp/src/concurrency/PosixThreadFactory.h
@@ -58,7 +58,7 @@
   boost::shared_ptr<Thread> newThread(boost::shared_ptr<Runnable> runnable) const;
 
   // From ThreadFactory;
-    Thread::id_t currentThreadId() const;
+  Thread::id_t currentThreadId() const;
 
   /**
    * Sets stack size for created threads
diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/concurrency/ThreadManager.cpp
index 7d78edb..1260e5a 100644
--- a/lib/cpp/src/concurrency/ThreadManager.cpp
+++ b/lib/cpp/src/concurrency/ThreadManager.cpp
@@ -248,8 +248,8 @@
 
             /* If we have a pending task max and we just dropped below it, wakeup any
                thread that might be blocked on add. */
-            if(manager_->pendingTaskCountMax_ != 0 &&
-               manager_->tasks_.size() == manager_->pendingTaskCountMax_ - 1) {
+            if (manager_->pendingTaskCountMax_ != 0 &&
+                manager_->tasks_.size() == manager_->pendingTaskCountMax_ - 1) {
               manager_->workerMonitor_.notify();
             }
 	  }
@@ -419,11 +419,11 @@
       throw IllegalStateException();
     }
 
-    if(pendingTaskCountMax_ > 0 && (tasks_.size() >= pendingTaskCountMax_)) {
+    if (pendingTaskCountMax_ > 0 && (tasks_.size() >= pendingTaskCountMax_)) {
 
-      if(canSleep()) {
+      if (canSleep()) {
 
-        while(pendingTaskCountMax_ > 0 && tasks_.size() >= pendingTaskCountMax_) {
+        while (pendingTaskCountMax_ > 0 && tasks_.size() >= pendingTaskCountMax_) {
           monitor_.wait(timeout);
         }
       } else {
@@ -449,7 +449,7 @@
 
 class SimpleThreadManager : public ThreadManager::Impl {
 
-public:
+ public:
   SimpleThreadManager(size_t workerCount=4, size_t pendingTaskCountMax=0) :
     workerCount_(workerCount),
     pendingTaskCountMax_(pendingTaskCountMax),
@@ -462,7 +462,7 @@
     addWorker(workerCount_);
   }
 
-private:
+ private:
   const size_t workerCount_;
   const size_t pendingTaskCountMax_;
   bool firstTime_;
diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/concurrency/TimerManager.cpp
index 8d6dd5e..07f05ad 100644
--- a/lib/cpp/src/concurrency/TimerManager.cpp
+++ b/lib/cpp/src/concurrency/TimerManager.cpp
@@ -98,8 +98,8 @@
 	  }
           assert((timeout != 0 && manager_->taskCount_ > 0) || (timeout == 0 && manager_->taskCount_ == 0));
           try {
-              manager_->monitor_.wait(timeout);
-          } catch(TimedOutException& e) {}
+            manager_->monitor_.wait(timeout);
+          } catch (TimedOutException &e) {}
 	  now = Util::currentTime();
 	}
 	
