Add a comment about a thread safety issue in Statistic.h.
authorDan Gohman <gohman@apple.com>
Thu, 24 Jun 2010 16:31:32 +0000 (16:31 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 24 Jun 2010 16:31:32 +0000 (16:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106756 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Statistic.h

index c593c58c127430ef5bf18cbf28e3d87d7e59913d..3a1319f1090ce0c4d42b52b1ec2f62775de3e563 100644 (file)
@@ -56,6 +56,10 @@ public:
   }
   
   const Statistic &operator++() {
+    // FIXME: This function and all those that follow carefully use an
+    // atomic operation to update the value safely in the presence of
+    // concurrent accesses, but not to read the return value, so the
+    // return value is not thread safe.
     sys::AtomicIncrement(&Value);
     return init();
   }