diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-01-04 12:19:37 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2019-01-07 12:08:23 -0500 |
commit | 11bb071e91461b1f8e40b9b15ddf3b9e1a2d23d1 (patch) | |
tree | 7037865f9bf4445fb3295ca7ce72f4182f012554 /src/mongo/bson | |
parent | 6a0a21214dd96663c899cb8f2562d6121351ed3c (diff) | |
download | mongo-11bb071e91461b1f8e40b9b15ddf3b9e1a2d23d1.tar.gz |
SERVER-36644 remove AtomicWord typedefs
Diffstat (limited to 'src/mongo/bson')
-rw-r--r-- | src/mongo/bson/oid.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/bson/oid.cpp b/src/mongo/bson/oid.cpp index b309f59639c..b55f818b729 100644 --- a/src/mongo/bson/oid.cpp +++ b/src/mongo/bson/oid.cpp @@ -36,6 +36,7 @@ #include <boost/functional/hash.hpp> #include <limits> +#include <memory> #include "mongo/base/init.h" #include "mongo/bson/bsonobjbuilder.h" @@ -46,7 +47,7 @@ namespace mongo { namespace { -std::unique_ptr<AtomicUInt32> counter; +std::unique_ptr<AtomicWord<int64_t>> counter; const std::size_t kTimestampOffset = 0; const std::size_t kInstanceUniqueOffset = kTimestampOffset + OID::kTimestampSize; @@ -57,7 +58,7 @@ OID::InstanceUnique _instanceUnique; MONGO_INITIALIZER_GENERAL(OIDGeneration, MONGO_NO_PREREQUISITES, ("default")) (InitializerContext* context) { std::unique_ptr<SecureRandom> entropy(SecureRandom::create()); - counter.reset(new AtomicUInt32(uint32_t(entropy->nextInt64()))); + counter = std::make_unique<AtomicWord<int64_t>>(entropy->nextInt64()); _instanceUnique = OID::InstanceUnique::generate(*entropy); return Status::OK(); } |