diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WTF/wtf/CryptographicallyRandomNumber.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WTF/wtf/CryptographicallyRandomNumber.cpp')
-rw-r--r-- | Source/WTF/wtf/CryptographicallyRandomNumber.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/WTF/wtf/CryptographicallyRandomNumber.cpp b/Source/WTF/wtf/CryptographicallyRandomNumber.cpp index 123608616..8bcb91607 100644 --- a/Source/WTF/wtf/CryptographicallyRandomNumber.cpp +++ b/Source/WTF/wtf/CryptographicallyRandomNumber.cpp @@ -33,6 +33,7 @@ #include "NeverDestroyed.h" #include "OSRandomSource.h" #include <mutex> +#include <wtf/Lock.h> namespace WTF { @@ -64,7 +65,7 @@ private: ARC4Stream m_stream; int m_count; - std::mutex m_mutex; + Lock m_mutex; }; ARC4Stream::ARC4Stream() @@ -136,7 +137,7 @@ uint32_t ARC4RandomNumberGenerator::getWord() uint32_t ARC4RandomNumberGenerator::randomNumber() { - std::lock_guard<std::mutex> lock(m_mutex); + std::lock_guard<Lock> lock(m_mutex); m_count -= 4; stirIfNeeded(); @@ -145,7 +146,7 @@ uint32_t ARC4RandomNumberGenerator::randomNumber() void ARC4RandomNumberGenerator::randomValues(void* buffer, size_t length) { - std::lock_guard<std::mutex> lock(m_mutex); + std::lock_guard<Lock> lock(m_mutex); unsigned char* result = reinterpret_cast<unsigned char*>(buffer); stirIfNeeded(); |