Ignore:
Timestamp:
Feb 17, 2012, 1:54:55 PM (13 years ago)
Author:
[email protected]
Message:

Remove unused parameters from WTF threading API
https://bugs.webkit.org/show_bug.cgi?id=78389

Patch by Kalev Lember <[email protected]> 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:

(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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r108107 r108119  
    188188        void waitForRelativeTime(double relative);
    189189        void blockFreeingThreadMain();
    190         static void* blockFreeingThreadStartFunc(void* heap);
     190        static void blockFreeingThreadStartFunc(void* heap);
    191191       
    192192        const HeapSize m_heapSize;
Note: See TracChangeset for help on using the changeset viewer.