diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-07-06 17:22:01 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-07-08 09:44:58 -0400 |
commit | 84f1302d8e9ada32e57dc152e29c25afe451f883 (patch) | |
tree | 962b65dc62543136dbef8afcc156949edb288983 /src/mongo/db/client.h | |
parent | 21c4ce42c34008a966e66214b1dd83cdc066bf1c (diff) | |
download | mongo-84f1302d8e9ada32e57dc152e29c25afe451f883.tar.gz |
SERVER-19315 Add PRNG to Client
Diffstat (limited to 'src/mongo/db/client.h')
-rw-r--r-- | src/mongo/db/client.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h index bff49a38ef3..24cc847a430 100644 --- a/src/mongo/db/client.h +++ b/src/mongo/db/client.h @@ -40,6 +40,7 @@ #include "mongo/db/namespace_string.h" #include "mongo/db/operation_context.h" #include "mongo/db/service_context.h" +#include "mongo/platform/random.h" #include "mongo/platform/unordered_set.h" #include "mongo/stdx/thread.h" #include "mongo/util/concurrency/spin_lock.h" @@ -137,6 +138,10 @@ public: return _connectionId > 0; } + PseudoRandom& getPrng() { + return _prng; + } + private: friend class ServiceContext; Client(std::string desc, ServiceContext* serviceContext, AbstractMessagingPort* p = 0); @@ -159,6 +164,8 @@ private: // If != NULL, then contains the currently active OperationContext OperationContext* _txn = nullptr; + + PseudoRandom _prng; }; /** get the Client object for this thread. */ |