Consistently have the namespace closing comment
[folly.git] / folly / detail / Sleeper.h
index 2d1f24874b27ef33e1fd6171226a48b8e8dfba15..ad8127c2d49b8600d2b8fce24e4defaa5751dab6 100644 (file)
@@ -32,33 +32,33 @@ namespace folly {
 
 namespace detail {
 
-  /*
  * A helper object for the contended case. Starts off with eager
  * spinning, and falls back to sleeping for small quantums.
  */
-  class Sleeper {
-    static const uint32_t kMaxActiveSpin = 4000;
+/*
+ * A helper object for the contended case. Starts off with eager
+ * spinning, and falls back to sleeping for small quantums.
+ */
+class Sleeper {
+  static const uint32_t kMaxActiveSpin = 4000;
 
-    uint32_t spinCount;
+  uint32_t spinCount;
 
  public:
-    Sleeper() : spinCount(0) {}
+ public:
+  Sleeper() : spinCount(0) {}
 
-    void wait() {
-      if (spinCount < kMaxActiveSpin) {
-        ++spinCount;
-        asm_volatile_pause();
-      } else {
-        /*
-         * Always sleep 0.5ms, assuming this will make the kernel put
-         * us down for whatever its minimum timer resolution is (in
-         * linux this varies by kernel version from 1ms to 10ms).
-         */
-        struct timespec ts = { 0, 500000 };
-        nanosleep(&ts, nullptr);
-      }
+  void wait() {
+    if (spinCount < kMaxActiveSpin) {
+      ++spinCount;
+      asm_volatile_pause();
+    } else {
+      /*
+       * Always sleep 0.5ms, assuming this will make the kernel put
+       * us down for whatever its minimum timer resolution is (in
+       * linux this varies by kernel version from 1ms to 10ms).
+       */
+      struct timespec ts = {0, 500000};
+      nanosleep(&ts, nullptr);
     }
-  };
+  }
+};
 
-}
-}
+} // namespace detail
+} // namespace folly