diff options
author | lloyd <[email protected]> | 2010-03-21 23:42:01 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-21 23:42:01 +0000 |
commit | a1fc16d73b6e8fbb041c5163687bfd37c5705da4 (patch) | |
tree | 1c4eb4b9ba661b56bf8b2f22f5cb94cf3fbc3f7d /src/libstate/global_rng.cpp | |
parent | f8a77dd91e8b3aed644c2c206ff9b8822fb3ae02 (diff) |
Post-merge fixups
Diffstat (limited to 'src/libstate/global_rng.cpp')
-rw-r--r-- | src/libstate/global_rng.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstate/global_rng.cpp b/src/libstate/global_rng.cpp index 411596da9..725ec2be1 100644 --- a/src/libstate/global_rng.cpp +++ b/src/libstate/global_rng.cpp @@ -107,60 +107,60 @@ class Serialized_PRNG : public RandomNumberGenerator public: void randomize(byte out[], u32bit len) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); rng->randomize(out, len); } bool is_seeded() const { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); return rng->is_seeded(); } void clear() { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); rng->clear(); } std::string name() const { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); return rng->name(); } void reseed(u32bit poll_bits) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); rng->reseed(poll_bits); } void add_entropy_source(EntropySource* es) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); rng->add_entropy_source(es); } void add_entropy(const byte in[], u32bit len) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); rng->add_entropy(in, len); } // We do not own the mutex; Library_State does - Serialized_PRNG(RandomNumberGenerator* r, Mutex* m) : + Serialized_PRNG(RandomNumberGenerator* r, std::mutex& m) : mutex(m), rng(r) {} ~Serialized_PRNG() { delete rng; } private: - Mutex* mutex; + std::mutex& mutex; RandomNumberGenerator* rng; }; } RandomNumberGenerator* Library_State::make_global_rng(Algorithm_Factory& af, - Mutex* mutex) + std::mutex& mutex) { RandomNumberGenerator* rng = 0; |