[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
jorlow at chromium.org
jorlow at chromium.org
Wed Mar 17 17:59:29 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit c47947e3b2895b3d7c97bdeb086b5cdb788abba8
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 25 18:20:41 2010 +0000
Reverting to re-submit with better change log.
* wtf/Threading.h:
* wtf/ThreadingNone.cpp:
(WTF::isMainThread):
* wtf/ThreadingPthreads.cpp:
(WTF::identifierByPthreadHandle):
(WTF::establishIdentifierForPthreadHandle):
(WTF::pthreadHandleForIdentifier):
(WTF::createThreadInternal):
(WTF::currentThread):
* wtf/ThreadingWin.cpp:
(WTF::threadMap):
(WTF::storeThreadHandleByIdentifier):
(WTF::threadHandleForIdentifier):
(WTF::createThreadInternal):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55246 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index f049f3e..a76e480 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-02-25 Jeremy Orlow <jorlow at chromium.org>
+
+ Reverting to re-submit with better change log.
+
+ * wtf/Threading.h:
+ * wtf/ThreadingNone.cpp:
+ (WTF::isMainThread):
+ * wtf/ThreadingPthreads.cpp:
+ (WTF::identifierByPthreadHandle):
+ (WTF::establishIdentifierForPthreadHandle):
+ (WTF::pthreadHandleForIdentifier):
+ (WTF::createThreadInternal):
+ (WTF::currentThread):
+ * wtf/ThreadingWin.cpp:
+ (WTF::threadMap):
+ (WTF::storeThreadHandleByIdentifier):
+ (WTF::threadHandleForIdentifier):
+ (WTF::createThreadInternal):
+
2010-02-25 Jochen Eisinger <jochen at chromium.org>
Reviewed by Jeremy Orlow.
diff --git a/JavaScriptCore/wtf/Threading.h b/JavaScriptCore/wtf/Threading.h
index b522915..b7a2f08 100644
--- a/JavaScriptCore/wtf/Threading.h
+++ b/JavaScriptCore/wtf/Threading.h
@@ -127,7 +127,6 @@ ThreadIdentifier currentThread();
bool isMainThread();
int waitForThreadCompletion(ThreadIdentifier, void**);
void detachThread(ThreadIdentifier);
-void* threadContext(ThreadIdentifier);
#if USE(PTHREADS)
typedef pthread_mutex_t PlatformMutex;
diff --git a/JavaScriptCore/wtf/ThreadingNone.cpp b/JavaScriptCore/wtf/ThreadingNone.cpp
index cfc9d31..2e8a259 100644
--- a/JavaScriptCore/wtf/ThreadingNone.cpp
+++ b/JavaScriptCore/wtf/ThreadingNone.cpp
@@ -41,7 +41,6 @@ int waitForThreadCompletion(ThreadIdentifier, void**) { return 0; }
void detachThread(ThreadIdentifier) { }
ThreadIdentifier currentThread() { return ThreadIdentifier(); }
bool isMainThread() { return true; }
-void* threadContext(ThreadIdentifier) { return 0; }
Mutex::Mutex() { }
Mutex::~Mutex() { }
diff --git a/JavaScriptCore/wtf/ThreadingPthreads.cpp b/JavaScriptCore/wtf/ThreadingPthreads.cpp
index e841f62..2feb808 100644
--- a/JavaScriptCore/wtf/ThreadingPthreads.cpp
+++ b/JavaScriptCore/wtf/ThreadingPthreads.cpp
@@ -53,12 +53,7 @@
namespace WTF {
-typedef struct {
- pthread_t handle;
- void* context;
-} ThreadInfo;
-
-typedef HashMap<ThreadIdentifier, ThreadInfo> ThreadMap;
+typedef HashMap<ThreadIdentifier, pthread_t> ThreadMap;
static Mutex* atomicallyInitializedStaticMutex;
@@ -110,14 +105,14 @@ static ThreadIdentifier identifierByPthreadHandle(const pthread_t& pthreadHandle
ThreadMap::iterator i = threadMap().begin();
for (; i != threadMap().end(); ++i) {
- if (pthread_equal(i->second.handle, pthreadHandle))
+ if (pthread_equal(i->second, pthreadHandle))
return i->first;
}
return 0;
}
-static ThreadIdentifier establishIdentifierForPthreadHandle(const pthread_t& pthreadHandle, void* context)
+static ThreadIdentifier establishIdentifierForPthreadHandle(const pthread_t& pthreadHandle)
{
ASSERT(!identifierByPthreadHandle(pthreadHandle));
@@ -125,10 +120,7 @@ static ThreadIdentifier establishIdentifierForPthreadHandle(const pthread_t& pth
static ThreadIdentifier identifierCount = 1;
- ThreadInfo info;
- info.handle = pthreadHandle;
- info.context = context;
- threadMap().add(identifierCount, info);
+ threadMap().add(identifierCount, pthreadHandle);
return identifierCount++;
}
@@ -137,17 +129,9 @@ static pthread_t pthreadHandleForIdentifier(ThreadIdentifier id)
{
MutexLocker locker(threadMapMutex());
- return threadMap().get(id).handle;
-}
-
-static void* contextForIdentifier(ThreadIdentifier id)
-{
- MutexLocker locker(threadMapMutex());
-
- return threadMap().get(id).context;
+ return threadMap().get(id);
}
-
void clearPthreadHandleForIdentifier(ThreadIdentifier id)
{
MutexLocker locker(threadMapMutex());
@@ -190,7 +174,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
delete threadData;
return 0;
}
- return establishIdentifierForPthreadHandle(threadHandle, data);
+ return establishIdentifierForPthreadHandle(threadHandle);
}
#else
ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
@@ -201,7 +185,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
return 0;
}
- return establishIdentifierForPthreadHandle(threadHandle, data);
+ return establishIdentifierForPthreadHandle(threadHandle);
}
#endif
@@ -251,7 +235,7 @@ ThreadIdentifier currentThread()
return id;
// Not a WTF-created thread, ThreadIdentifier is not established yet.
- id = establishIdentifierForPthreadHandle(pthread_self(), 0);
+ id = establishIdentifierForPthreadHandle(pthread_self());
ThreadIdentifierData::initialize(id);
return id;
}
@@ -265,11 +249,6 @@ bool isMainThread()
#endif
}
-void* threadContext(ThreadIdentifier id)
-{
- return contextForIdentifier(id);
-}
-
Mutex::Mutex()
{
pthread_mutex_init(&m_mutex, NULL);
diff --git a/JavaScriptCore/wtf/ThreadingWin.cpp b/JavaScriptCore/wtf/ThreadingWin.cpp
index 75da7b4..73c3f0c 100644
--- a/JavaScriptCore/wtf/ThreadingWin.cpp
+++ b/JavaScriptCore/wtf/ThreadingWin.cpp
@@ -118,11 +118,6 @@ typedef struct tagTHREADNAME_INFO {
} THREADNAME_INFO;
#pragma pack(pop)
-typedef struct {
- HANDLE handle;
- void* context;
-} ThreadInfo;
-
void initializeCurrentThreadInternal(const char* szThreadName)
{
THREADNAME_INFO info;
@@ -170,32 +165,23 @@ void initializeThreading()
}
}
-static HashMap<DWORD, ThreadInfo>& threadMap()
+static HashMap<DWORD, HANDLE>& threadMap()
{
- static HashMap<DWORD, ThreadInfo> map;
+ static HashMap<DWORD, HANDLE> map;
return map;
}
-static void storeThreadHandleByIdentifier(DWORD threadID, HANDLE threadHandle, void* context)
+static void storeThreadHandleByIdentifier(DWORD threadID, HANDLE threadHandle)
{
MutexLocker locker(threadMapMutex());
ASSERT(!threadMap().contains(threadID));
- ThreadInfo info;
- info.handle = threadHandle;
- info.context = context;
- threadMap().add(threadID, info);
+ threadMap().add(threadID, threadHandle);
}
static HANDLE threadHandleForIdentifier(ThreadIdentifier id)
{
MutexLocker locker(threadMapMutex());
- return threadMap().get(id).handle;
-}
-
-static void* contextForIdentifier(ThreadIdentifier id)
-{
- MutexLocker locker(threadMapMutex());
- return threadMap().get(id).context;
+ return threadMap().get(id);
}
static void clearThreadHandleForIdentifier(ThreadIdentifier id)
@@ -251,7 +237,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
}
threadID = static_cast<ThreadIdentifier>(threadIdentifier);
- storeThreadHandleByIdentifier(threadIdentifier, threadHandle, data);
+ storeThreadHandleByIdentifier(threadIdentifier, threadHandle);
return threadID;
}
@@ -294,11 +280,6 @@ bool isMainThread()
return currentThread() == mainThreadIdentifier;
}
-void* threadContext(ThreadIdentifier threadID)
-{
- return contextForIdentifier(threadID);
-}
-
Mutex::Mutex()
{
m_mutex.m_recursionCount = 0;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list