Replace all uses of std::mutex/std::condition_variable with WTF::Lock/WTF::Condition
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 18:18:19 +0000 (18:18 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 18:18:19 +0000 (18:18 +0000)
commit74c195afa5065f64b6c6c20a82760a374927643e
tree7acc125d49a38a226cbed51d1cbc9d6a0ce54ef9
parent6e4409d3f0a8720b026c26172c7c6af099a2a0f1
Replace all uses of std::mutex/std::condition_variable with WTF::Lock/WTF::Condition
https://bugs.webkit.org/show_bug.cgi?id=148140

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::registerDebuggable):
(Inspector::RemoteInspector::unregisterDebuggable):
(Inspector::RemoteInspector::updateDebuggable):
(Inspector::RemoteInspector::updateDebuggableAutomaticInspectCandidate):
(Inspector::RemoteInspector::sendMessageToRemoteFrontend):
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::setupCompleted):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::stop):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::setParentProcessInformation):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::pushListingSoon):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
* inspector/remote/RemoteInspectorXPCConnection.h:
* inspector/remote/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::closeFromMessage):
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
(Inspector::RemoteInspectorXPCConnection::handleEvent):

Source/WebCore:

No new tests because no new behavior.

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process):
(WebCore::AudioBufferSourceNode::setBuffer):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::insertEvent):
(WebCore::AudioParamTimeline::cancelScheduledValues):
(WebCore::AudioParamTimeline::valueForContextTime):
(WebCore::AudioParamTimeline::valuesForTimeRange):
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::process):
(WebCore::ConvolverNode::reset):
(WebCore::ConvolverNode::setBuffer):
* Modules/webaudio/ConvolverNode.h:
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::process):
* Modules/webaudio/MediaElementAudioSourceNode.h:
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::setFormat):
(WebCore::MediaStreamAudioSourceNode::process):
* Modules/webaudio/MediaStreamAudioSourceNode.h:
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::process):
(WebCore::OscillatorNode::setPeriodicWave):
* Modules/webaudio/OscillatorNode.h:
* Modules/webaudio/PannerNode.cpp:
(WebCore::PannerNode::process):
(WebCore::PannerNode::setPanningModel):
* Modules/webaudio/PannerNode.h:
* Modules/webaudio/WaveShaperProcessor.cpp:
(WebCore::WaveShaperProcessor::setCurve):
(WebCore::WaveShaperProcessor::setOversample):
(WebCore::WaveShaperProcessor::process):
* Modules/webaudio/WaveShaperProcessor.h:
* Modules/webdatabase/Database.cpp:
(WebCore::retrieveTextResultFromDatabase):
(WebCore::guidToVersionMap):
(WebCore::Database::Database):
(WebCore::Database::performOpenAndVerify):
(WebCore::Database::closeDatabase):
(WebCore::Database::getCachedVersion):
(WebCore::Database::setCachedVersion):
(WebCore::guidMutex): Deleted.
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::existingDatabaseContextFor):
(WebCore::DatabaseManager::registerDatabaseContext):
(WebCore::DatabaseManager::unregisterDatabaseContext):
(WebCore::DatabaseManager::didConstructDatabaseContext):
(WebCore::DatabaseManager::didDestructDatabaseContext):
(WebCore::DatabaseManager::addProposedDatabase):
(WebCore::DatabaseManager::removeProposedDatabase):
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* Modules/webdatabase/DatabaseManager.h:
* bindings/objc/DOMInternal.mm:
(getDOMWrapper):
(addDOMWrapper):
(removeDOMWrapper):
(wrapperCacheLock): Deleted.
* crypto/CryptoAlgorithmRegistry.cpp:
(WebCore::CryptoAlgorithmRegistry::singleton):
(WebCore::CryptoAlgorithmRegistry::CryptoAlgorithmRegistry):
(WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
(WebCore::CryptoAlgorithmRegistry::nameForIdentifier):
(WebCore::CryptoAlgorithmRegistry::create):
(WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
(WebCore::registryMutex): Deleted.
* inspector/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
* page/WheelEventTestTrigger.cpp:
(WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
(WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
(WebCore::WheelEventTestTrigger::deferTestsForReason):
(WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
(WebCore::WheelEventTestTrigger::triggerTestTimerFired):
* page/WheelEventTestTrigger.h:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::dispatch):
(WebCore::ScrollingThread::createThreadIfNeeded):
(WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
* page/scrolling/ScrollingThread.h:
* page/scrolling/mac/ScrollingThreadMac.mm:
(WebCore::ScrollingThread::initializeRunLoop):
* platform/audio/ReverbConvolver.cpp:
(WebCore::ReverbConvolver::~ReverbConvolver):
(WebCore::ReverbConvolver::backgroundThreadEntry):
(WebCore::ReverbConvolver::process):
(WebCore::ReverbConvolver::reset):
* platform/audio/ReverbConvolver.h:
* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/mac/Language.mm:
(WebCore::preferredLanguages):
(+[WebLanguageChangeObserver languagePreferencesDidChange:]):
(WebCore::platformUserPreferredLanguages):
(WebCore::preferredLanguagesMutex): Deleted.
* platform/network/cf/LoaderRunLoopCF.cpp:
(WebCore::emptyPerform):
(WebCore::runLoaderThread):
(WebCore::loaderRunLoop):
(WebCore::loaderRunLoopMutex): Deleted.
(WebCore::loaderRunLoopConditionVariable): Deleted.
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::callOnMainThreadAndWait):
* platform/network/curl/SocketStreamHandle.h:
* platform/network/curl/SocketStreamHandleCurl.cpp:
(WebCore::SocketStreamHandle::platformSend):
(WebCore::SocketStreamHandle::sendData):
* platform/sql/SQLiteDatabaseTracker.cpp:
(WebCore::SQLiteDatabaseTracker::setClient):
(WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::transactionInProgressMutex): Deleted.
* platform/text/TextBreakIterator.cpp:
(WebCore::compareAndSwapNonSharedCharacterBreakIterator):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::newTextCodec):
(WebCore::atomicCanonicalTextEncodingName):
(WebCore::dumpTextEncodingNameMap):
(WebCore::encodingRegistryMutex): Deleted.
* workers/WorkerThread.cpp:
(WebCore::workerThreads):
(WebCore::WorkerThread::workerThreadCount):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::~WorkerThread):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
(WebCore::threadSetMutex): Deleted.

Source/WebKit2:

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::traverse):
* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::SyncMessageState::dispatchMessages):
(IPC::Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesForConnection):
(IPC::Connection::sendMessage):
(IPC::Connection::waitForMessage):
(IPC::Connection::processIncomingMessage):
(IPC::Connection::installIncomingSyncMessageCallback):
(IPC::Connection::uninstallIncomingSyncMessageCallback):
(IPC::Connection::hasIncomingSyncMessage):
(IPC::Connection::connectionDidClose):
(IPC::Connection::sendOutgoingMessages):
(IPC::Connection::enqueueIncomingMessage):
(IPC::Connection::dispatchOneMessage):
* Platform/IPC/Connection.h:
* Shared/BlockingResponseMap.h:
(BlockingResponseMap::waitForResponse):
(BlockingResponseMap::didReceiveResponse):
(BlockingResponseMap::cancel):
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::saveToFile):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/Plugins/gtk/PluginInfoCache.h:
* UIProcess/mac/WKPrintingView.h:
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(prepareDataForPrintingOnSecondaryThread):
(-[WKPrintingView knowsPageRange:]):

Source/WTF:

Also beef up Condition by giving it a StaticCondition variant.

* wtf/Condition.h:
(WTF::ConditionBase::notifyAll):
(WTF::ConditionBase::waitForSecondsImpl):
(WTF::ConditionBase::absoluteFromRelative):
(WTF::Condition::Condition):
(WTF::Condition::notifyAll): Deleted.
(WTF::Condition::waitForSecondsImpl): Deleted.
(WTF::Condition::absoluteFromRelative): Deleted.
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/HashTable.cpp:
(WTF::HashTableStats::recordCollisionAtCount):
(WTF::HashTableStats::dumpStats):
(WTF::hashTableStatsMutex): Deleted.
* wtf/HashTable.h:
(WTF::KeyTraits>::HashTable):
(WTF::KeyTraits>::invalidateIterators):
(WTF::addIterator):
(WTF::removeIterator):
* wtf/Lock.h:
* wtf/MainThread.cpp:
(WTF::functionQueue):
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
(WTF::cancelCallOnMainThread):
(WTF::mainThreadFunctionQueueMutex): Deleted.
* wtf/StackStats.cpp:
(WTF::StackStats::PerThreadStats::PerThreadStats):
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
(WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
(WTF::StackStats::initialize): Deleted.
* wtf/StackStats.h:
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::initialize): Deleted.
* wtf/ThreadingPthreads.cpp:
(WTF::initializeThreading):
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
(WTF::callOnMainThread):
(WTF::lockAtomicallyInitializedStaticMutex):
(WTF::unlockAtomicallyInitializedStaticMutex):
(WTF::atomicallyInitializedStaticMutex): Deleted.
* wtf/text/StringView.cpp:
(WTF::StringView::UnderlyingString::UnderlyingString):
(WTF::underlyingStrings):
(WTF::StringView::invalidate):
(WTF::StringView::adoptUnderlyingString):
(WTF::StringView::setUnderlyingString):
(WTF::underlyingStringsMutex): Deleted.
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
(WTF::cachedCollatorMutex): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
67 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/remote/RemoteInspector.h
Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
Source/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.h
Source/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.mm
Source/WTF/ChangeLog
Source/WTF/wtf/Condition.h
Source/WTF/wtf/CryptographicallyRandomNumber.cpp
Source/WTF/wtf/HashTable.cpp
Source/WTF/wtf/HashTable.h
Source/WTF/wtf/Lock.h
Source/WTF/wtf/MainThread.cpp
Source/WTF/wtf/StackStats.cpp
Source/WTF/wtf/StackStats.h
Source/WTF/wtf/ThreadingPthreads.cpp
Source/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm
Source/WTF/wtf/text/StringView.cpp
Source/WTF/wtf/unicode/icu/CollatorICU.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h
Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp
Source/WebCore/Modules/webaudio/AudioParamTimeline.h
Source/WebCore/Modules/webaudio/ConvolverNode.cpp
Source/WebCore/Modules/webaudio/ConvolverNode.h
Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp
Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.h
Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h
Source/WebCore/Modules/webaudio/OscillatorNode.cpp
Source/WebCore/Modules/webaudio/OscillatorNode.h
Source/WebCore/Modules/webaudio/PannerNode.cpp
Source/WebCore/Modules/webaudio/PannerNode.h
Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp
Source/WebCore/Modules/webaudio/WaveShaperProcessor.h
Source/WebCore/Modules/webdatabase/Database.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.h
Source/WebCore/bindings/objc/DOMInternal.mm
Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
Source/WebCore/inspector/WorkerDebuggerAgent.cpp
Source/WebCore/page/WheelEventTestTrigger.cpp
Source/WebCore/page/WheelEventTestTrigger.h
Source/WebCore/page/scrolling/ScrollingThread.cpp
Source/WebCore/page/scrolling/ScrollingThread.h
Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm
Source/WebCore/platform/audio/ReverbConvolver.cpp
Source/WebCore/platform/audio/ReverbConvolver.h
Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp
Source/WebCore/platform/mac/Language.mm
Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp
Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
Source/WebCore/platform/network/curl/SocketStreamHandle.h
Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp
Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp
Source/WebCore/platform/text/TextBreakIterator.cpp
Source/WebCore/platform/text/TextEncodingRegistry.cpp
Source/WebCore/workers/WorkerThread.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
Source/WebKit2/Platform/IPC/Connection.cpp
Source/WebKit2/Platform/IPC/Connection.h
Source/WebKit2/Shared/BlockingResponseMap.h
Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp
Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.h
Source/WebKit2/UIProcess/mac/WKPrintingView.h
Source/WebKit2/UIProcess/mac/WKPrintingView.mm