summaryrefslogtreecommitdiff
path: root/Source/WTF/wtf/CryptographicallyRandomNumber.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WTF/wtf/CryptographicallyRandomNumber.cpp')
-rw-r--r--Source/WTF/wtf/CryptographicallyRandomNumber.cpp7
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();