Reviewed by David Levin.
Rename all uses of JSC_MULTIPLE_THREADS under wtf/... to WTF_MULTIPLE_THREADS
https://bugs.webkit.org/show_bug.cgi?id=59040
This will be used to fix https://bugs.webkit.org/show_bug.cgi?id=55728
by enabling WTF_MULTIPLE_THREADS for Chromium.
* wtf/CryptographicallyRandomNumber.cpp:
(WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
(WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
* wtf/FastMalloc.cpp:
* wtf/Platform.h:
Enable WTF_MULTIPLE_THREADS whenever JSC_MULTIPLE_THREADS is enabled.
* wtf/RandomNumber.cpp:
(WTF::randomNumber):
* wtf/RefCountedLeakCounter.cpp:
(WTF::RefCountedLeakCounter::increment):
(WTF::RefCountedLeakCounter::decrement):
* wtf/dtoa.cpp:
(WTF::pow5mult):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84466
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-04-20 Adam Klein <adamk@chromium.org>
+
+ Reviewed by David Levin.
+
+ Rename all uses of JSC_MULTIPLE_THREADS under wtf/... to WTF_MULTIPLE_THREADS
+ https://bugs.webkit.org/show_bug.cgi?id=59040
+
+ This will be used to fix https://bugs.webkit.org/show_bug.cgi?id=55728
+ by enabling WTF_MULTIPLE_THREADS for Chromium.
+
+ * wtf/CryptographicallyRandomNumber.cpp:
+ (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
+ (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
+ * wtf/FastMalloc.cpp:
+ * wtf/Platform.h:
+ Enable WTF_MULTIPLE_THREADS whenever JSC_MULTIPLE_THREADS is enabled.
+ * wtf/RandomNumber.cpp:
+ (WTF::randomNumber):
+ * wtf/RefCountedLeakCounter.cpp:
+ (WTF::RefCountedLeakCounter::increment):
+ (WTF::RefCountedLeakCounter::decrement):
+ * wtf/dtoa.cpp:
+ (WTF::pow5mult):
+
2011-04-20 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Geoff Garen
ARC4Stream m_stream;
int m_count;
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
Mutex m_mutex;
#endif
};
uint32_t ARC4RandomNumberGenerator::randomNumber()
{
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
MutexLocker locker(m_mutex);
#else
ASSERT(isMainThread());
void ARC4RandomNumberGenerator::randomValues(void* buffer, size_t length)
{
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
MutexLocker locker(m_mutex);
#else
ASSERT(isMainThread());
#include "Assertions.h"
#include <limits>
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
#include <pthread.h>
#endif
#include <wtf/StdLibExtras.h>
#ifndef NDEBUG
namespace WTF {
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
static pthread_key_t isForbiddenKey;
static pthread_once_t isForbiddenKeyOnce = PTHREAD_ONCE_INIT;
static void initializeIsForbiddenKey()
{
staticIsForbidden = false;
}
-#endif // ENABLE(JSC_MULTIPLE_THREADS)
+#endif // ENABLE(WTF_MULTIPLE_THREADS)
} // namespace WTF
#endif // NDEBUG
#define ENABLE_JSC_MULTIPLE_THREADS 1
#endif
+#if ENABLE(JSC_MULTIPLE_THREADS)
+#define ENABLE_WTF_MULTIPLE_THREADS 1
+#endif
+
/* On Windows, use QueryPerformanceCounter by default */
#if OS(WINDOWS)
#define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
// that might not be cryptographically secure. Ideally, most ports would
// define USE(OS_RANDOMNESS).
-#if !ENABLE(JSC_MULTIPLE_THREADS)
+#if !ENABLE(WTF_MULTIPLE_THREADS)
static bool s_initialized = false;
if (!s_initialized) {
initializeRandomNumberGenerator();
void RefCountedLeakCounter::increment()
{
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
atomicIncrement(&m_count);
#else
++m_count;
void RefCountedLeakCounter::decrement()
{
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
atomicDecrement(&m_count);
#else
--m_count;
namespace WTF {
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
Mutex* s_dtoaP5Mutex;
#endif
if (!(k >>= 2))
return;
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->lock();
#endif
P5Node* p5 = p5s;
}
int p5sCountLocal = p5sCount;
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->unlock();
#endif
int p5sUsed = 0;
break;
if (++p5sUsed == p5sCountLocal) {
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->lock();
#endif
if (p5sUsed == p5sCount) {
}
p5sCountLocal = p5sCount;
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->unlock();
#endif
}