https://bugs.webkit.org/show_bug.cgi?id=68423
As discussed on webkit-dev. All ports build with threads enabled in WTF now.
This may break WinCE and other ports that have not built and tested with
this configuration. I've filed bugs for port maintainers. It's time for
WebKit to move forward.
Reviewed by Mark Rowe.
* wtf/CryptographicallyRandomNumber.cpp:
(WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
(WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
* wtf/FastMalloc.cpp:
* wtf/Platform.h:
* wtf/RandomNumber.cpp:
(WTF::randomNumber):
* wtf/RefCountedLeakCounter.cpp:
(WTF::RefCountedLeakCounter::increment):
(WTF::RefCountedLeakCounter::decrement):
* wtf/ThreadingPthreads.cpp:
(WTF::initializeThreading):
* wtf/ThreadingWin.cpp:
(WTF::initializeThreading):
* wtf/dtoa.cpp:
(WTF::pow5mult):
* wtf/gtk/ThreadingGtk.cpp:
(WTF::initializeThreading):
* wtf/qt/ThreadingQt.cpp:
(WTF::initializeThreading):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95511
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2011-09-19 Geoffrey Garen <ggaren@apple.com>
+ Removed ENABLE_WTF_MULTIPLE_THREADS and related #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=68423
+
+ As discussed on webkit-dev. All ports build with threads enabled in WTF now.
+
+ This may break WinCE and other ports that have not built and tested with
+ this configuration. I've filed bugs for port maintainers. It's time for
+ WebKit to move forward.
+
+ Reviewed by Mark Rowe.
+
+ * wtf/CryptographicallyRandomNumber.cpp:
+ (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
+ (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
+ * wtf/FastMalloc.cpp:
+ * wtf/Platform.h:
+ * wtf/RandomNumber.cpp:
+ (WTF::randomNumber):
+ * wtf/RefCountedLeakCounter.cpp:
+ (WTF::RefCountedLeakCounter::increment):
+ (WTF::RefCountedLeakCounter::decrement):
+ * wtf/ThreadingPthreads.cpp:
+ (WTF::initializeThreading):
+ * wtf/ThreadingWin.cpp:
+ (WTF::initializeThreading):
+ * wtf/dtoa.cpp:
+ (WTF::pow5mult):
+ * wtf/gtk/ThreadingGtk.cpp:
+ (WTF::initializeThreading):
+ * wtf/qt/ThreadingQt.cpp:
+ (WTF::initializeThreading):
+
+2011-09-19 Geoffrey Garen <ggaren@apple.com>
+
Removed ENABLE_JSC_MULTIPLE_THREADS and related #ifdefs.
https://bugs.webkit.org/show_bug.cgi?id=68422
ARC4Stream m_stream;
int m_count;
-#if ENABLE(WTF_MULTIPLE_THREADS)
Mutex m_mutex;
-#endif
};
ARC4Stream::ARC4Stream()
uint32_t ARC4RandomNumberGenerator::randomNumber()
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
MutexLocker locker(m_mutex);
-#endif
m_count -= 4;
stirIfNeeded();
void ARC4RandomNumberGenerator::randomValues(void* buffer, size_t length)
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
MutexLocker locker(m_mutex);
-#endif
unsigned char* result = reinterpret_cast<unsigned char*>(buffer);
stirIfNeeded();
#include "Assertions.h"
#include <limits>
-#if ENABLE(WTF_MULTIPLE_THREADS)
#if OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
#include <windows.h>
#else
#include <pthread.h>
#endif // OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
-#endif
#include <wtf/StdLibExtras.h>
+#include <string.h>
#ifndef NO_TCMALLOC_SAMPLES
#ifdef WTF_CHANGES
#ifndef NDEBUG
namespace WTF {
-#if ENABLE(WTF_MULTIPLE_THREADS)
#if OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
// TLS_OUT_OF_INDEXES is not defined on WinCE.
pthread_setspecific(isForbiddenKey, 0);
}
#endif // OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
-#else
-
-static bool staticIsForbidden;
-static bool isForbidden()
-{
- return staticIsForbidden;
-}
-
-void fastMallocForbid()
-{
- staticIsForbidden = true;
-}
-
-void fastMallocAllow()
-{
- staticIsForbidden = false;
-}
-#endif // ENABLE(WTF_MULTIPLE_THREADS)
} // namespace WTF
#endif // NDEBUG
-#include <string.h>
-
namespace WTF {
#define WTF_USE_PTHREAD_BASED_QT 1
#endif
-#if !defined(ENABLE_WTF_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(WTF_MULTIPLE_THREADS)
- static bool s_initialized = false;
- if (!s_initialized) {
- initializeRandomNumberGenerator();
- s_initialized = true;
- }
-#endif
-
#if USE(MERSENNE_TWISTER_19937)
return genrand_res53();
#elif PLATFORM(BREWMP)
void RefCountedLeakCounter::increment()
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
atomicIncrement(&m_count);
-#else
- ++m_count;
-#endif
}
void RefCountedLeakCounter::decrement()
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
atomicDecrement(&m_count);
-#else
- --m_count;
-#endif
}
#endif
initializeRandomNumberGenerator();
ThreadIdentifierData::initializeOnce();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
}
void lockAtomicallyInitializedStaticMutex()
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
-
}
static HashMap<DWORD, HANDLE>& threadMap()
namespace WTF {
-#if ENABLE(WTF_MULTIPLE_THREADS)
Mutex* s_dtoaP5Mutex;
-#endif
typedef union {
double d;
if (!(k >>= 2))
return;
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->lock();
-#endif
P5Node* p5 = p5s;
if (!p5) {
}
int p5sCountLocal = p5sCount;
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->unlock();
-#endif
int p5sUsed = 0;
for (;;) {
break;
if (++p5sUsed == p5sCountLocal) {
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->lock();
-#endif
if (p5sUsed == p5sCount) {
ASSERT(!p5->next);
p5->next = new P5Node;
}
p5sCountLocal = p5sCount;
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->unlock();
-#endif
}
p5 = p5->next;
}
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
}
}
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
-
}
}