Fix integer sign consistency.
[folly.git] / folly / experimental / hazptr / hazptr.h
index 5c71b34eefb0289ca81b4b79efadc38a64d4be2c..21df54e6bab443cd2a20973bbf577781021e6a89 100644 (file)
@@ -80,6 +80,9 @@ class hazptr_domain {
   std::atomic<hazptr_obj*> retired_ = {nullptr};
   std::atomic<int> hcount_ = {0};
   std::atomic<int> rcount_ = {0};
+  /* Using signed int for rcount_ because it may transiently be
+   * negative.  Using signed int for all integer variables that may be
+   * involved in calculations related to the value of rcount_. */
 
   void objRetire(hazptr_obj*);
   hazptr_rec* hazptrAcquire();