Index: runtime/vm/atomic.h |
diff --git a/runtime/vm/random.h b/runtime/vm/atomic.h |
similarity index 50% |
copy from runtime/vm/random.h |
copy to runtime/vm/atomic.h |
index c1c69d63efed579195a8314f3126327415c2526f..64defc02007a5c3eb1d4e8de08c14e236fc4c6e2 100644 |
--- a/runtime/vm/random.h |
+++ b/runtime/vm/atomic.h |
@@ -2,30 +2,21 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-#ifndef VM_RANDOM_H_ |
-#define VM_RANDOM_H_ |
+#ifndef VM_ATOMIC_H_ |
+#define VM_ATOMIC_H_ |
-#include "vm/globals.h" |
#include "vm/allocation.h" |
namespace dart { |
-class Random : public ValueObject { |
+class AtomicOperations : public AllStatic { |
public: |
- Random(); |
- ~Random(); |
- |
- uint32_t NextUInt32(); |
- |
- private: |
- void NextState(); |
- |
- uint64_t _state; |
- |
- DISALLOW_ALLOCATION(); |
- DISALLOW_COPY_AND_ASSIGN(Random); |
+ // Atomically fetch the value at p and increment the value at p. |
+ // Returns the original value at p. |
+ static uintptr_t FetchAndIncrement(uintptr_t* p); |
}; |
+ |
} // namespace dart |
-#endif // VM_RANDOM_H_ |
+#endif // VM_ATOMIC_H_ |