Remove unused parameters from WTF threading API
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 21:54:55 +0000 (21:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 21:54:55 +0000 (21:54 +0000)
commita3d434cc59e4247ff8266d9049f6ca78c8ff35c0
treeb48aa6df84129780ed3481781a06649fd0ad516e
parent6f116fe96515b9dd53cdf45f1c57edca382c02fd
Remove unused parameters from WTF threading API
https://bugs.webkit.org/show_bug.cgi?id=78389

Patch by Kalev Lember <kalevlember@gmail.com> on 2012-02-17
Reviewed by Adam Roben.

waitForThreadCompletion() had an out param 'void **result' to get the
'void *' returned by ThreadFunction. However, the implementation in
ThreadingWin.cpp ignored the out param, not filling it in. This had
led to a situation where none of the client code made use of the param
and just ignored it.

To clean this up, the patch changes the signature of ThreadFunction to
return void instead of void* and drops the the unused 'void **result'
parameter from waitForThreadCompletion. Also, all client code is
updated for the API change.

As mentioned in https://bugs.webkit.org/show_bug.cgi?id=78389 , even
though the change only affects internal API, Safari is using it
directly and we'll need to keep the old versions around for ABI
compatibility. For this, the patch adds compatibility wrappers with
the old ABI.

Source/JavaScriptCore:

* JavaScriptCore.order:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* bytecode/SamplingTool.cpp:
(JSC::SamplingThread::threadStartFunc):
(JSC::SamplingThread::stop):
* bytecode/SamplingTool.h:
(SamplingThread):
* heap/Heap.cpp:
(JSC::Heap::~Heap):
(JSC::Heap::blockFreeingThreadStartFunc):
* heap/Heap.h:
* heap/MarkStack.cpp:
(JSC::MarkStackThreadSharedData::markingThreadStartFunc):
(JSC::MarkStackThreadSharedData::~MarkStackThreadSharedData):
* heap/MarkStack.h:
(MarkStackThreadSharedData):
* wtf/ParallelJobsGeneric.cpp:
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h:
(ThreadPrivate):
* wtf/ThreadFunctionInvocation.h: Update the signature of
ThreadFunction.
(WTF):
* wtf/Threading.cpp:
(WTF::threadEntryPoint): Update for ThreadFunction signature change.
(WTF):
(WTF::ThreadFunctionWithReturnValueInvocation::ThreadFunctionWithReturnValueInvocation):
ABI compatibility function for Safari.
(ThreadFunctionWithReturnValueInvocation): Ditto.
(WTF::compatEntryPoint): Ditto.
(WTF::createThread): Ditto.
(WTF::waitForThreadCompletion): Ditto.
* wtf/Threading.h: Update the signature of ThreadFunction and
waitForThreadCompletion.
(WTF):
* wtf/ThreadingPthreads.cpp: Implement the new API.
(WTF::wtfThreadEntryPoint):
(WTF):
(WTF::createThreadInternal):
(WTF::waitForThreadCompletion):
* wtf/ThreadingWin.cpp: Implement the new API.
(WTF::wtfThreadEntryPoint):
(WTF::waitForThreadCompletion):

Source/WebCore:

* bindings/js/GCController.cpp:
(WebCore::collect):
(WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
* fileapi/FileThread.cpp:
(WebCore::FileThread::fileThreadStart):
(WebCore::FileThread::runLoop):
* fileapi/FileThread.h:
(FileThread):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::close):
(WebCore::IconDatabase::iconDatabaseSyncThreadStart):
(WebCore::IconDatabase::iconDatabaseSyncThread):
(WebCore::IconDatabase::syncThreadMainLoop):
* loader/icon/IconDatabase.h:
(IconDatabase):
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::threadCallback):
* page/scrolling/ScrollingThread.h:
(ScrollingThread):
* platform/audio/HRTFDatabaseLoader.cpp:
(WebCore::databaseLoaderEntry):
(WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
* platform/audio/ReverbConvolver.cpp:
(WebCore::backgroundThreadEntry):
(WebCore::ReverbConvolver::~ReverbConvolver):
* platform/network/cf/LoaderRunLoopCF.cpp:
(WebCore::runLoaderThread):
* storage/DatabaseThread.cpp:
(WebCore::DatabaseThread::databaseThreadStart):
(WebCore::DatabaseThread::databaseThread):
* storage/DatabaseThread.h:
(DatabaseThread):
* storage/LocalStorageThread.cpp:
(WebCore::LocalStorageThread::threadEntryPointCallback):
(WebCore::LocalStorageThread::threadEntryPoint):
(WebCore::LocalStorageThread::terminate):
* storage/LocalStorageThread.h:
(LocalStorageThread):
* webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::~AsyncAudioDecoder):
(WebCore::AsyncAudioDecoder::threadEntry):
* webaudio/AsyncAudioDecoder.h:
(AsyncAudioDecoder):
* webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::uninitialize):
(WebCore::OfflineAudioDestinationNode::renderEntry):
* webaudio/OfflineAudioDestinationNode.h:
(OfflineAudioDestinationNode):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThreadStart):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
(WorkerThread):

Source/WebKit/win:

* WebKit.vcproj/WebKit_Cairo.def: Add the new functions.
* WebKit.vcproj/WebKit_Cairo_debug.def: Ditto.

Source/WebKit2:

* Platform/WorkQueue.h:
(WorkQueue):
* Platform/gtk/WorkQueueGtk.cpp:
(WorkQueue::startWorkQueueThread):
* UIProcess/Launcher/mac/ThreadLauncherMac.mm:
(WebKit::webThreadBody):
* UIProcess/Launcher/qt/ThreadLauncherQt.cpp:
(WebKit::webThreadBody):
* UIProcess/Launcher/win/ThreadLauncherWin.cpp:
(WebKit::webThreadBody):
* WebProcess/WebProcess.cpp:
(WebKit::randomCrashThread):
* win/WebKit2.def:
* win/WebKit2CFLite.def:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
49 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.order
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/bytecode/SamplingTool.cpp
Source/JavaScriptCore/bytecode/SamplingTool.h
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/MarkStack.cpp
Source/JavaScriptCore/heap/MarkStack.h
Source/JavaScriptCore/wtf/ParallelJobsGeneric.cpp
Source/JavaScriptCore/wtf/ParallelJobsGeneric.h
Source/JavaScriptCore/wtf/ThreadFunctionInvocation.h
Source/JavaScriptCore/wtf/Threading.cpp
Source/JavaScriptCore/wtf/Threading.h
Source/JavaScriptCore/wtf/ThreadingPthreads.cpp
Source/JavaScriptCore/wtf/ThreadingWin.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/GCController.cpp
Source/WebCore/fileapi/FileThread.cpp
Source/WebCore/fileapi/FileThread.h
Source/WebCore/loader/icon/IconDatabase.cpp
Source/WebCore/loader/icon/IconDatabase.h
Source/WebCore/page/scrolling/ScrollingThread.cpp
Source/WebCore/page/scrolling/ScrollingThread.h
Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp
Source/WebCore/platform/audio/ReverbConvolver.cpp
Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp
Source/WebCore/storage/DatabaseThread.cpp
Source/WebCore/storage/DatabaseThread.h
Source/WebCore/storage/LocalStorageThread.cpp
Source/WebCore/storage/LocalStorageThread.h
Source/WebCore/webaudio/AsyncAudioDecoder.cpp
Source/WebCore/webaudio/AsyncAudioDecoder.h
Source/WebCore/webaudio/OfflineAudioDestinationNode.cpp
Source/WebCore/webaudio/OfflineAudioDestinationNode.h
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
Source/WebKit/win/WebKit.vcproj/WebKit_Cairo_debug.def
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/WorkQueue.h
Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
Source/WebKit2/UIProcess/Launcher/mac/ThreadLauncherMac.mm
Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp
Source/WebKit2/UIProcess/Launcher/win/ThreadLauncherWin.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def