haikuwebkit/Source/WTF/wtf/RecursiveLockAdapter.h

106 lines
3.5 KiB
C
Raw Permalink Normal View History

/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
[WTF] Remove StaticLock https://bugs.webkit.org/show_bug.cgi?id=184332 Reviewed by Mark Lam. Source/JavaScriptCore: * API/JSValue.mm: (handerForStructTag): * API/JSVirtualMachine.mm: (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]): (+[JSVMWrapperCache wrapperForJSContextGroupRef:]): * API/glib/JSCVirtualMachine.cpp: (addWrapper): (removeWrapper): * assembler/testmasm.cpp: * b3/air/testair.cpp: * b3/testb3.cpp: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dynbench.cpp: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): * interpreter/CLoopStack.cpp: * parser/SourceProvider.cpp: * profiler/ProfilerDatabase.cpp: * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/IntlObject.cpp: (JSC::numberingSystemsForLocale): * runtime/JSLock.cpp: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::registerForReportAtExit): * runtime/VM.cpp: * wasm/WasmFaultSignalHandler.cpp: Source/WebCore: No behavior change. * Modules/webdatabase/Database.cpp: (WebCore::Database::Database): (WebCore::Database::performOpenAndVerify): (WebCore::Database::closeDatabase): (WebCore::Database::getCachedVersion const): (WebCore::Database::setCachedVersion): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsMutex): * Modules/websockets/WebSocket.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::identifier): (WebCore::CryptoAlgorithmRegistry::name): (WebCore::CryptoAlgorithmRegistry::create): (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): * dom/Node.cpp: * platform/URL.cpp: * platform/graphics/FontCache.cpp: * platform/graphics/MediaPlayer.cpp: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThread.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/curl/CurlContext.cpp: (WebCore::CurlShareHandle::mutexFor): * platform/network/curl/CurlContext.h: * platform/sql/SQLiteDatabaseTracker.cpp: (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount): (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount): * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::newTextCodec): (WebCore::atomicCanonicalTextEncodingName): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThreadCount): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::~WorkerThread): (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads): Source/WebKitLegacy/ios: * WebCoreSupport/WebFixedPositionContent.mm: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: (getDOMWrapper): (addDOMWrapper): (removeDOMWrapper): Source/WebKitLegacy/win: * WebKitQuartzCoreAdditions/CAView.cpp: (WKQCA::CAView::releaseAllD3DResources): * WebLocalizableStrings.cpp: Source/WTF: Now, WTF::StaticLock is `using StaticLock = Lock`. Lock just works in either static storage and dynamic storage. Remove StaticLock and always use Lock. We also remove StaticWordLock and StaticReadWriteLock. And we add WTF::RecursiveLock, which is RecursiveLockAdapter<Lock>. * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/Language.cpp: (WTF::userPreferredLanguages): * wtf/Lock.h: * wtf/MainThread.cpp: (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/ParkingLot.cpp: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/StackStats.h: * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/ThreadingPthreads.cpp: * wtf/ThreadingWin.cpp: * wtf/WordLock.h: * wtf/cf/LanguageCF.cpp: (WTF::languagePreferencesDidChange): (WTF::platformUserPreferredLanguages): * wtf/dtoa.cpp: * wtf/text/AtomicStringImpl.cpp: * wtf/text/StringView.cpp: (WTF::StringView::invalidate): (WTF::StringView::adoptUnderlyingString): (WTF::StringView::setUnderlyingString): * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::Collator): (WTF::Collator::~Collator): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): Tools: * DumpRenderTree/JavaScriptThreading.cpp: Canonical link: https://commits.webkit.org/199887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-05 17:22:21 +00:00
#include <wtf/Lock.h>
#include <wtf/Threading.h>
namespace WTF {
template<typename LockType>
class RecursiveLockAdapter {
public:
[WTF] Remove XXXLockBase since constexpr constructor can initialize static variables without calling global constructors https://bugs.webkit.org/show_bug.cgi?id=180495 Reviewed by Mark Lam. Very nice feature of C++11 is that constexpr constructor can initialize static global variables without calling global constructors. We do not need to have XXXLockBase with derived XXXLock class since StaticXXXLock can have constructors as long as it is constexpr. We remove bunch of these classes, and set `XXXLock() = default;` explicitly for readability. C++11's default constructor is constexpr as long as its member's default constructor / default initializer is constexpr. * wtf/Condition.h: (WTF::ConditionBase::construct): Deleted. (WTF::ConditionBase::waitUntil): Deleted. (WTF::ConditionBase::waitFor): Deleted. (WTF::ConditionBase::wait): Deleted. (WTF::ConditionBase::notifyOne): Deleted. (WTF::ConditionBase::notifyAll): Deleted. (WTF::Condition::Condition): Deleted. * wtf/CountingLock.h: (WTF::CountingLock::CountingLock): Deleted. (WTF::CountingLock::~CountingLock): Deleted. * wtf/Lock.cpp: (WTF::Lock::lockSlow): (WTF::Lock::unlockSlow): (WTF::Lock::unlockFairlySlow): (WTF::Lock::safepointSlow): (WTF::LockBase::lockSlow): Deleted. (WTF::LockBase::unlockSlow): Deleted. (WTF::LockBase::unlockFairlySlow): Deleted. (WTF::LockBase::safepointSlow): Deleted. * wtf/Lock.h: (WTF::LockBase::construct): Deleted. (WTF::LockBase::lock): Deleted. (WTF::LockBase::tryLock): Deleted. (WTF::LockBase::try_lock): Deleted. (WTF::LockBase::unlock): Deleted. (WTF::LockBase::unlockFairly): Deleted. (WTF::LockBase::safepoint): Deleted. (WTF::LockBase::isHeld const): Deleted. (WTF::LockBase::isLocked const): Deleted. (WTF::LockBase::isFullyReset const): Deleted. (WTF::Lock::Lock): Deleted. * wtf/ReadWriteLock.cpp: (WTF::ReadWriteLock::readLock): (WTF::ReadWriteLock::readUnlock): (WTF::ReadWriteLock::writeLock): (WTF::ReadWriteLock::writeUnlock): (WTF::ReadWriteLockBase::construct): Deleted. (WTF::ReadWriteLockBase::readLock): Deleted. (WTF::ReadWriteLockBase::readUnlock): Deleted. (WTF::ReadWriteLockBase::writeLock): Deleted. (WTF::ReadWriteLockBase::writeUnlock): Deleted. * wtf/ReadWriteLock.h: (WTF::ReadWriteLock::read): (WTF::ReadWriteLock::write): (WTF::ReadWriteLockBase::ReadLock::tryLock): Deleted. (WTF::ReadWriteLockBase::ReadLock::lock): Deleted. (WTF::ReadWriteLockBase::ReadLock::unlock): Deleted. (WTF::ReadWriteLockBase::WriteLock::tryLock): Deleted. (WTF::ReadWriteLockBase::WriteLock::lock): Deleted. (WTF::ReadWriteLockBase::WriteLock::unlock): Deleted. (WTF::ReadWriteLockBase::read): Deleted. (WTF::ReadWriteLockBase::write): Deleted. (WTF::ReadWriteLock::ReadWriteLock): Deleted. * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::RecursiveLockAdapter): Deleted. * wtf/WordLock.cpp: (WTF::WordLock::lockSlow): (WTF::WordLock::unlockSlow): (WTF::WordLockBase::lockSlow): Deleted. (WTF::WordLockBase::unlockSlow): Deleted. * wtf/WordLock.h: (WTF::WordLockBase::lock): Deleted. (WTF::WordLockBase::unlock): Deleted. (WTF::WordLockBase::isHeld const): Deleted. (WTF::WordLockBase::isLocked const): Deleted. (WTF::WordLockBase::isFullyReset const): Deleted. (WTF::WordLock::WordLock): Deleted. * wtf/WorkQueue.cpp: Canonical link: https://commits.webkit.org/196438@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-07 03:52:09 +00:00
RecursiveLockAdapter() = default;
// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because the function does conditional locking, which is
// not supported by analysis. Also RecursiveLockAdapter may wrap a lock type besides WTF::Lock
// which doesn't support analysis.
void lock() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
{
WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. Source/JavaScriptCore: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): * runtime/ExceptionScope.cpp: (JSC::ExceptionScope::unexpectedExceptionMessage): * runtime/JSLock.h: (JSC::JSLock::currentThreadIsHoldingLock): * runtime/VM.cpp: (JSC::VM::throwException): * runtime/VM.h: (JSC::VM::throwingThread const): (JSC::VM::clearException): * tools/HeapVerifier.cpp: (JSC::HeapVerifier::printVerificationHeader): Source/WebCore: No behavior change. * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::originThread const): (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): (WebCore::IDBActiveDOMObject::originThreadID const): Deleted. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted const): (WebCore::IDBCursor::transaction const): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity const): (WebCore::IDBDatabase::name const): (WebCore::IDBDatabase::version const): (WebCore::IDBDatabase::objectStoreNames const): (WebCore::IDBDatabase::renameObjectStore): (WebCore::IDBDatabase::renameIndex): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::connectionToServerLost): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName const): (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name const): (WebCore::IDBIndex::setName): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath const): (WebCore::IDBIndex::unique const): (WebCore::IDBIndex::multiEntry const): (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name const): (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::keyPath const): (WebCore::IDBObjectStore::indexNames const): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement const): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore:: const): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction const): (WebCore::IDBRequest::sourceObjectStoreIdentifier const): (WebCore::IDBRequest::sourceIndexIdentifier const): (WebCore::IDBRequest::requestedObjectStoreRecordType const): (WebCore::IDBRequest::requestedIndexRecordType const): (WebCore::IDBRequest::eventTargetInterface const): (WebCore::IDBRequest::activeDOMObjectName const): (WebCore::IDBRequest::canSuspendForDocumentSuspension const): (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::completeRequestAndDispatchEvent): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::objectStoreNames const): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::error const): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName const): (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): (WebCore::IDBTransaction::hasPendingActivity const): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive const): (WebCore::IDBTransaction::isFinishedOrFinishing const): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::pendingOperationTimerFired): (WebCore::IDBTransaction::operationCompletedOnServer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): (WebCore::IDBTransaction::completedOperationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::renameObjectStoreOnServer): (WebCore::IDBTransaction::didRenameObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::renameIndexOnServer): (WebCore::IDBTransaction::didRenameIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::getAllRecordsOnServer): (WebCore::IDBTransaction::didGetAllRecordsOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationCompletedOnClient): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::removeItemsMatchingCurrentThread): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread): (WebCore::IDBClient::TransactionOperation::transitionToComplete): (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::TransactionOperation::originThread const): (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::lock): (WebCore::AudioContext::tryLock): (WebCore::AudioContext::unlock): (WebCore::AudioContext::isAudioThread const): (WebCore::AudioContext::isGraphOwner const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::setAudioThread): (WebCore::AudioContext::audioThread const): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): (WebCore::DatabaseDetails::thread const): (WebCore::DatabaseDetails::threadID const): Deleted. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThread): (WebCore::DatabaseThread::getThreadID): Deleted. * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * page/ResourceUsageOverlay.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::isCurrentThread): * platform/Supplementable.h: (WebCore::Supplementable::provideSupplement): (WebCore::Supplementable::removeSupplement): (WebCore::Supplementable::requireSupplement): (WebCore::Supplementable::Supplementable): Deleted. * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (): Deleted. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::close): * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::isContextThread const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): * workers/WorkerThread.h: (WebCore::WorkerThread::thread const): (WebCore::WorkerThread::threadID const): Deleted. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): (WebCore::ServiceWorkerContainer::contextIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJob.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::matchFunc): (WebCore::openFunc): (WebCore::initializeXMLParser): (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Source/WebKit: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): Source/WTF: We should use a pointer of WTF::Thread instead of ThreadIdentifier. One problem is that Windows support library uses WTF::createThread, which returns ThreadIdentifier. So we cannot drop ThreadIdentifier in Windows environment. This patch keeps ThreadIdentifier in Windows. * wtf/MainThread.cpp: (WTF::initializeMainThread): (WTF::isMainThread): (WTF::canAccessThreadLocalDataForThread): * wtf/MainThread.h: * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): (WTF::ParkingLot::unparkOne): (WTF::ParkingLot::unparkOneImpl): (WTF::ParkingLot::unparkCount): * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::lock): (WTF::RecursiveLockAdapter::unlock): (WTF::RecursiveLockAdapter::tryLock): * wtf/Threading.cpp: (WTF::Thread::dump const): * wtf/Threading.h: (WTF::Thread::id const): (WTF::Thread::operator==): Deleted. (WTF::Thread::operator!=): Deleted. (WTF::currentThread): Deleted. * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::initializeCurrentTLS): (WTF::Thread::suspend): (WTF::Thread::establishPlatformSpecificHandle): (WTF::Thread::currentID): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::suspend): (WTF::Thread::currentDying): * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThread): (WTF::initializeWebThreadPlatform): (WTF::canAccessThreadLocalDataForThread): (WTF::initializeApplicationUIThreadIdentifier): Deleted. (WTF::initializeWebThreadIdentifier): Deleted. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): (runThread): Deleted. (runPthread): Deleted. (testThreadIdentifierMap): Deleted. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ParkingLot.cpp: * TestWebKitAPI/Tests/WTF/Threading.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-04 06:13:05 +00:00
Thread& me = Thread::current();
if (&me == m_owner) {
m_recursionCount++;
return;
}
m_lock.lock();
ASSERT(!m_owner);
ASSERT(!m_recursionCount);
WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. Source/JavaScriptCore: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): * runtime/ExceptionScope.cpp: (JSC::ExceptionScope::unexpectedExceptionMessage): * runtime/JSLock.h: (JSC::JSLock::currentThreadIsHoldingLock): * runtime/VM.cpp: (JSC::VM::throwException): * runtime/VM.h: (JSC::VM::throwingThread const): (JSC::VM::clearException): * tools/HeapVerifier.cpp: (JSC::HeapVerifier::printVerificationHeader): Source/WebCore: No behavior change. * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::originThread const): (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): (WebCore::IDBActiveDOMObject::originThreadID const): Deleted. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted const): (WebCore::IDBCursor::transaction const): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity const): (WebCore::IDBDatabase::name const): (WebCore::IDBDatabase::version const): (WebCore::IDBDatabase::objectStoreNames const): (WebCore::IDBDatabase::renameObjectStore): (WebCore::IDBDatabase::renameIndex): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::connectionToServerLost): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName const): (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name const): (WebCore::IDBIndex::setName): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath const): (WebCore::IDBIndex::unique const): (WebCore::IDBIndex::multiEntry const): (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name const): (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::keyPath const): (WebCore::IDBObjectStore::indexNames const): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement const): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore:: const): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction const): (WebCore::IDBRequest::sourceObjectStoreIdentifier const): (WebCore::IDBRequest::sourceIndexIdentifier const): (WebCore::IDBRequest::requestedObjectStoreRecordType const): (WebCore::IDBRequest::requestedIndexRecordType const): (WebCore::IDBRequest::eventTargetInterface const): (WebCore::IDBRequest::activeDOMObjectName const): (WebCore::IDBRequest::canSuspendForDocumentSuspension const): (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::completeRequestAndDispatchEvent): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::objectStoreNames const): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::error const): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName const): (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): (WebCore::IDBTransaction::hasPendingActivity const): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive const): (WebCore::IDBTransaction::isFinishedOrFinishing const): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::pendingOperationTimerFired): (WebCore::IDBTransaction::operationCompletedOnServer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): (WebCore::IDBTransaction::completedOperationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::renameObjectStoreOnServer): (WebCore::IDBTransaction::didRenameObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::renameIndexOnServer): (WebCore::IDBTransaction::didRenameIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::getAllRecordsOnServer): (WebCore::IDBTransaction::didGetAllRecordsOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationCompletedOnClient): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::removeItemsMatchingCurrentThread): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread): (WebCore::IDBClient::TransactionOperation::transitionToComplete): (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::TransactionOperation::originThread const): (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::lock): (WebCore::AudioContext::tryLock): (WebCore::AudioContext::unlock): (WebCore::AudioContext::isAudioThread const): (WebCore::AudioContext::isGraphOwner const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::setAudioThread): (WebCore::AudioContext::audioThread const): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): (WebCore::DatabaseDetails::thread const): (WebCore::DatabaseDetails::threadID const): Deleted. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThread): (WebCore::DatabaseThread::getThreadID): Deleted. * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * page/ResourceUsageOverlay.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::isCurrentThread): * platform/Supplementable.h: (WebCore::Supplementable::provideSupplement): (WebCore::Supplementable::removeSupplement): (WebCore::Supplementable::requireSupplement): (WebCore::Supplementable::Supplementable): Deleted. * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (): Deleted. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::close): * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::isContextThread const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): * workers/WorkerThread.h: (WebCore::WorkerThread::thread const): (WebCore::WorkerThread::threadID const): Deleted. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): (WebCore::ServiceWorkerContainer::contextIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJob.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::matchFunc): (WebCore::openFunc): (WebCore::initializeXMLParser): (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Source/WebKit: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): Source/WTF: We should use a pointer of WTF::Thread instead of ThreadIdentifier. One problem is that Windows support library uses WTF::createThread, which returns ThreadIdentifier. So we cannot drop ThreadIdentifier in Windows environment. This patch keeps ThreadIdentifier in Windows. * wtf/MainThread.cpp: (WTF::initializeMainThread): (WTF::isMainThread): (WTF::canAccessThreadLocalDataForThread): * wtf/MainThread.h: * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): (WTF::ParkingLot::unparkOne): (WTF::ParkingLot::unparkOneImpl): (WTF::ParkingLot::unparkCount): * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::lock): (WTF::RecursiveLockAdapter::unlock): (WTF::RecursiveLockAdapter::tryLock): * wtf/Threading.cpp: (WTF::Thread::dump const): * wtf/Threading.h: (WTF::Thread::id const): (WTF::Thread::operator==): Deleted. (WTF::Thread::operator!=): Deleted. (WTF::currentThread): Deleted. * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::initializeCurrentTLS): (WTF::Thread::suspend): (WTF::Thread::establishPlatformSpecificHandle): (WTF::Thread::currentID): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::suspend): (WTF::Thread::currentDying): * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThread): (WTF::initializeWebThreadPlatform): (WTF::canAccessThreadLocalDataForThread): (WTF::initializeApplicationUIThreadIdentifier): Deleted. (WTF::initializeWebThreadIdentifier): Deleted. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): (runThread): Deleted. (runPthread): Deleted. (testThreadIdentifierMap): Deleted. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ParkingLot.cpp: * TestWebKitAPI/Tests/WTF/Threading.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-04 06:13:05 +00:00
m_owner = &me;
m_recursionCount = 1;
}
// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because the function does conditional unlocking, which is
// not supported by analysis. Also RecursiveLockAdapter may wrap a lock type besides WTF::Lock
// which doesn't support analysis.
void unlock() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
{
if (--m_recursionCount)
return;
WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. Source/JavaScriptCore: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): * runtime/ExceptionScope.cpp: (JSC::ExceptionScope::unexpectedExceptionMessage): * runtime/JSLock.h: (JSC::JSLock::currentThreadIsHoldingLock): * runtime/VM.cpp: (JSC::VM::throwException): * runtime/VM.h: (JSC::VM::throwingThread const): (JSC::VM::clearException): * tools/HeapVerifier.cpp: (JSC::HeapVerifier::printVerificationHeader): Source/WebCore: No behavior change. * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::originThread const): (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): (WebCore::IDBActiveDOMObject::originThreadID const): Deleted. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted const): (WebCore::IDBCursor::transaction const): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity const): (WebCore::IDBDatabase::name const): (WebCore::IDBDatabase::version const): (WebCore::IDBDatabase::objectStoreNames const): (WebCore::IDBDatabase::renameObjectStore): (WebCore::IDBDatabase::renameIndex): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::connectionToServerLost): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName const): (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name const): (WebCore::IDBIndex::setName): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath const): (WebCore::IDBIndex::unique const): (WebCore::IDBIndex::multiEntry const): (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name const): (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::keyPath const): (WebCore::IDBObjectStore::indexNames const): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement const): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore:: const): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction const): (WebCore::IDBRequest::sourceObjectStoreIdentifier const): (WebCore::IDBRequest::sourceIndexIdentifier const): (WebCore::IDBRequest::requestedObjectStoreRecordType const): (WebCore::IDBRequest::requestedIndexRecordType const): (WebCore::IDBRequest::eventTargetInterface const): (WebCore::IDBRequest::activeDOMObjectName const): (WebCore::IDBRequest::canSuspendForDocumentSuspension const): (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::completeRequestAndDispatchEvent): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::objectStoreNames const): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::error const): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName const): (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): (WebCore::IDBTransaction::hasPendingActivity const): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive const): (WebCore::IDBTransaction::isFinishedOrFinishing const): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::pendingOperationTimerFired): (WebCore::IDBTransaction::operationCompletedOnServer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): (WebCore::IDBTransaction::completedOperationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::renameObjectStoreOnServer): (WebCore::IDBTransaction::didRenameObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::renameIndexOnServer): (WebCore::IDBTransaction::didRenameIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::getAllRecordsOnServer): (WebCore::IDBTransaction::didGetAllRecordsOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationCompletedOnClient): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::removeItemsMatchingCurrentThread): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread): (WebCore::IDBClient::TransactionOperation::transitionToComplete): (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::TransactionOperation::originThread const): (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::lock): (WebCore::AudioContext::tryLock): (WebCore::AudioContext::unlock): (WebCore::AudioContext::isAudioThread const): (WebCore::AudioContext::isGraphOwner const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::setAudioThread): (WebCore::AudioContext::audioThread const): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): (WebCore::DatabaseDetails::thread const): (WebCore::DatabaseDetails::threadID const): Deleted. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThread): (WebCore::DatabaseThread::getThreadID): Deleted. * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * page/ResourceUsageOverlay.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::isCurrentThread): * platform/Supplementable.h: (WebCore::Supplementable::provideSupplement): (WebCore::Supplementable::removeSupplement): (WebCore::Supplementable::requireSupplement): (WebCore::Supplementable::Supplementable): Deleted. * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (): Deleted. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::close): * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::isContextThread const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): * workers/WorkerThread.h: (WebCore::WorkerThread::thread const): (WebCore::WorkerThread::threadID const): Deleted. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): (WebCore::ServiceWorkerContainer::contextIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJob.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::matchFunc): (WebCore::openFunc): (WebCore::initializeXMLParser): (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Source/WebKit: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): Source/WTF: We should use a pointer of WTF::Thread instead of ThreadIdentifier. One problem is that Windows support library uses WTF::createThread, which returns ThreadIdentifier. So we cannot drop ThreadIdentifier in Windows environment. This patch keeps ThreadIdentifier in Windows. * wtf/MainThread.cpp: (WTF::initializeMainThread): (WTF::isMainThread): (WTF::canAccessThreadLocalDataForThread): * wtf/MainThread.h: * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): (WTF::ParkingLot::unparkOne): (WTF::ParkingLot::unparkOneImpl): (WTF::ParkingLot::unparkCount): * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::lock): (WTF::RecursiveLockAdapter::unlock): (WTF::RecursiveLockAdapter::tryLock): * wtf/Threading.cpp: (WTF::Thread::dump const): * wtf/Threading.h: (WTF::Thread::id const): (WTF::Thread::operator==): Deleted. (WTF::Thread::operator!=): Deleted. (WTF::currentThread): Deleted. * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::initializeCurrentTLS): (WTF::Thread::suspend): (WTF::Thread::establishPlatformSpecificHandle): (WTF::Thread::currentID): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::suspend): (WTF::Thread::currentDying): * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThread): (WTF::initializeWebThreadPlatform): (WTF::canAccessThreadLocalDataForThread): (WTF::initializeApplicationUIThreadIdentifier): Deleted. (WTF::initializeWebThreadIdentifier): Deleted. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): (runThread): Deleted. (runPthread): Deleted. (testThreadIdentifierMap): Deleted. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ParkingLot.cpp: * TestWebKitAPI/Tests/WTF/Threading.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-04 06:13:05 +00:00
m_owner = nullptr;
m_lock.unlock();
}
// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because the function does conditional locking, which is
// not supported by analysis. Also RecursiveLockAdapter may wrap a lock type besides WTF::Lock
// which doesn't support analysis.
bool tryLock() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
{
WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. Source/JavaScriptCore: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): * runtime/ExceptionScope.cpp: (JSC::ExceptionScope::unexpectedExceptionMessage): * runtime/JSLock.h: (JSC::JSLock::currentThreadIsHoldingLock): * runtime/VM.cpp: (JSC::VM::throwException): * runtime/VM.h: (JSC::VM::throwingThread const): (JSC::VM::clearException): * tools/HeapVerifier.cpp: (JSC::HeapVerifier::printVerificationHeader): Source/WebCore: No behavior change. * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::originThread const): (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): (WebCore::IDBActiveDOMObject::originThreadID const): Deleted. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted const): (WebCore::IDBCursor::transaction const): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity const): (WebCore::IDBDatabase::name const): (WebCore::IDBDatabase::version const): (WebCore::IDBDatabase::objectStoreNames const): (WebCore::IDBDatabase::renameObjectStore): (WebCore::IDBDatabase::renameIndex): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::connectionToServerLost): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName const): (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name const): (WebCore::IDBIndex::setName): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath const): (WebCore::IDBIndex::unique const): (WebCore::IDBIndex::multiEntry const): (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name const): (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::keyPath const): (WebCore::IDBObjectStore::indexNames const): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement const): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore:: const): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction const): (WebCore::IDBRequest::sourceObjectStoreIdentifier const): (WebCore::IDBRequest::sourceIndexIdentifier const): (WebCore::IDBRequest::requestedObjectStoreRecordType const): (WebCore::IDBRequest::requestedIndexRecordType const): (WebCore::IDBRequest::eventTargetInterface const): (WebCore::IDBRequest::activeDOMObjectName const): (WebCore::IDBRequest::canSuspendForDocumentSuspension const): (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::completeRequestAndDispatchEvent): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::objectStoreNames const): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::error const): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName const): (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): (WebCore::IDBTransaction::hasPendingActivity const): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive const): (WebCore::IDBTransaction::isFinishedOrFinishing const): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::pendingOperationTimerFired): (WebCore::IDBTransaction::operationCompletedOnServer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): (WebCore::IDBTransaction::completedOperationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::renameObjectStoreOnServer): (WebCore::IDBTransaction::didRenameObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::renameIndexOnServer): (WebCore::IDBTransaction::didRenameIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::getAllRecordsOnServer): (WebCore::IDBTransaction::didGetAllRecordsOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationCompletedOnClient): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::removeItemsMatchingCurrentThread): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread): (WebCore::IDBClient::TransactionOperation::transitionToComplete): (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::TransactionOperation::originThread const): (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::lock): (WebCore::AudioContext::tryLock): (WebCore::AudioContext::unlock): (WebCore::AudioContext::isAudioThread const): (WebCore::AudioContext::isGraphOwner const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::setAudioThread): (WebCore::AudioContext::audioThread const): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): (WebCore::DatabaseDetails::thread const): (WebCore::DatabaseDetails::threadID const): Deleted. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThread): (WebCore::DatabaseThread::getThreadID): Deleted. * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * page/ResourceUsageOverlay.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::isCurrentThread): * platform/Supplementable.h: (WebCore::Supplementable::provideSupplement): (WebCore::Supplementable::removeSupplement): (WebCore::Supplementable::requireSupplement): (WebCore::Supplementable::Supplementable): Deleted. * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (): Deleted. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::close): * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::isContextThread const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): * workers/WorkerThread.h: (WebCore::WorkerThread::thread const): (WebCore::WorkerThread::threadID const): Deleted. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): (WebCore::ServiceWorkerContainer::contextIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJob.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::matchFunc): (WebCore::openFunc): (WebCore::initializeXMLParser): (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Source/WebKit: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): Source/WTF: We should use a pointer of WTF::Thread instead of ThreadIdentifier. One problem is that Windows support library uses WTF::createThread, which returns ThreadIdentifier. So we cannot drop ThreadIdentifier in Windows environment. This patch keeps ThreadIdentifier in Windows. * wtf/MainThread.cpp: (WTF::initializeMainThread): (WTF::isMainThread): (WTF::canAccessThreadLocalDataForThread): * wtf/MainThread.h: * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): (WTF::ParkingLot::unparkOne): (WTF::ParkingLot::unparkOneImpl): (WTF::ParkingLot::unparkCount): * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::lock): (WTF::RecursiveLockAdapter::unlock): (WTF::RecursiveLockAdapter::tryLock): * wtf/Threading.cpp: (WTF::Thread::dump const): * wtf/Threading.h: (WTF::Thread::id const): (WTF::Thread::operator==): Deleted. (WTF::Thread::operator!=): Deleted. (WTF::currentThread): Deleted. * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::initializeCurrentTLS): (WTF::Thread::suspend): (WTF::Thread::establishPlatformSpecificHandle): (WTF::Thread::currentID): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::suspend): (WTF::Thread::currentDying): * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThread): (WTF::initializeWebThreadPlatform): (WTF::canAccessThreadLocalDataForThread): (WTF::initializeApplicationUIThreadIdentifier): Deleted. (WTF::initializeWebThreadIdentifier): Deleted. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): (runThread): Deleted. (runPthread): Deleted. (testThreadIdentifierMap): Deleted. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ParkingLot.cpp: * TestWebKitAPI/Tests/WTF/Threading.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-04 06:13:05 +00:00
Thread& me = Thread::current();
if (&me == m_owner) {
m_recursionCount++;
return true;
}
if (!m_lock.tryLock())
return false;
ASSERT(!m_owner);
ASSERT(!m_recursionCount);
WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. Source/JavaScriptCore: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): * runtime/ExceptionScope.cpp: (JSC::ExceptionScope::unexpectedExceptionMessage): * runtime/JSLock.h: (JSC::JSLock::currentThreadIsHoldingLock): * runtime/VM.cpp: (JSC::VM::throwException): * runtime/VM.h: (JSC::VM::throwingThread const): (JSC::VM::clearException): * tools/HeapVerifier.cpp: (JSC::HeapVerifier::printVerificationHeader): Source/WebCore: No behavior change. * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::originThread const): (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): (WebCore::IDBActiveDOMObject::originThreadID const): Deleted. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted const): (WebCore::IDBCursor::transaction const): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity const): (WebCore::IDBDatabase::name const): (WebCore::IDBDatabase::version const): (WebCore::IDBDatabase::objectStoreNames const): (WebCore::IDBDatabase::renameObjectStore): (WebCore::IDBDatabase::renameIndex): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::connectionToServerLost): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName const): (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name const): (WebCore::IDBIndex::setName): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath const): (WebCore::IDBIndex::unique const): (WebCore::IDBIndex::multiEntry const): (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name const): (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::keyPath const): (WebCore::IDBObjectStore::indexNames const): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement const): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore:: const): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction const): (WebCore::IDBRequest::sourceObjectStoreIdentifier const): (WebCore::IDBRequest::sourceIndexIdentifier const): (WebCore::IDBRequest::requestedObjectStoreRecordType const): (WebCore::IDBRequest::requestedIndexRecordType const): (WebCore::IDBRequest::eventTargetInterface const): (WebCore::IDBRequest::activeDOMObjectName const): (WebCore::IDBRequest::canSuspendForDocumentSuspension const): (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::completeRequestAndDispatchEvent): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::objectStoreNames const): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::error const): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName const): (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): (WebCore::IDBTransaction::hasPendingActivity const): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive const): (WebCore::IDBTransaction::isFinishedOrFinishing const): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::pendingOperationTimerFired): (WebCore::IDBTransaction::operationCompletedOnServer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): (WebCore::IDBTransaction::completedOperationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::renameObjectStoreOnServer): (WebCore::IDBTransaction::didRenameObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::renameIndexOnServer): (WebCore::IDBTransaction::didRenameIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::getAllRecordsOnServer): (WebCore::IDBTransaction::didGetAllRecordsOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationCompletedOnClient): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::removeItemsMatchingCurrentThread): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread): (WebCore::IDBClient::TransactionOperation::transitionToComplete): (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::TransactionOperation::originThread const): (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::lock): (WebCore::AudioContext::tryLock): (WebCore::AudioContext::unlock): (WebCore::AudioContext::isAudioThread const): (WebCore::AudioContext::isGraphOwner const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::setAudioThread): (WebCore::AudioContext::audioThread const): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): (WebCore::DatabaseDetails::thread const): (WebCore::DatabaseDetails::threadID const): Deleted. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThread): (WebCore::DatabaseThread::getThreadID): Deleted. * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * page/ResourceUsageOverlay.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::isCurrentThread): * platform/Supplementable.h: (WebCore::Supplementable::provideSupplement): (WebCore::Supplementable::removeSupplement): (WebCore::Supplementable::requireSupplement): (WebCore::Supplementable::Supplementable): Deleted. * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (): Deleted. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::close): * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::isContextThread const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): * workers/WorkerThread.h: (WebCore::WorkerThread::thread const): (WebCore::WorkerThread::threadID const): Deleted. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): (WebCore::ServiceWorkerContainer::contextIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJob.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::matchFunc): (WebCore::openFunc): (WebCore::initializeXMLParser): (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Source/WebKit: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): Source/WTF: We should use a pointer of WTF::Thread instead of ThreadIdentifier. One problem is that Windows support library uses WTF::createThread, which returns ThreadIdentifier. So we cannot drop ThreadIdentifier in Windows environment. This patch keeps ThreadIdentifier in Windows. * wtf/MainThread.cpp: (WTF::initializeMainThread): (WTF::isMainThread): (WTF::canAccessThreadLocalDataForThread): * wtf/MainThread.h: * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): (WTF::ParkingLot::unparkOne): (WTF::ParkingLot::unparkOneImpl): (WTF::ParkingLot::unparkCount): * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::lock): (WTF::RecursiveLockAdapter::unlock): (WTF::RecursiveLockAdapter::tryLock): * wtf/Threading.cpp: (WTF::Thread::dump const): * wtf/Threading.h: (WTF::Thread::id const): (WTF::Thread::operator==): Deleted. (WTF::Thread::operator!=): Deleted. (WTF::currentThread): Deleted. * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::initializeCurrentTLS): (WTF::Thread::suspend): (WTF::Thread::establishPlatformSpecificHandle): (WTF::Thread::currentID): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::suspend): (WTF::Thread::currentDying): * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThread): (WTF::initializeWebThreadPlatform): (WTF::canAccessThreadLocalDataForThread): (WTF::initializeApplicationUIThreadIdentifier): Deleted. (WTF::initializeWebThreadIdentifier): Deleted. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): (runThread): Deleted. (runPthread): Deleted. (testThreadIdentifierMap): Deleted. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ParkingLot.cpp: * TestWebKitAPI/Tests/WTF/Threading.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-04 06:13:05 +00:00
m_owner = &me;
m_recursionCount = 1;
return true;
}
bool isLocked() const
{
return m_lock.isLocked();
}
Use WTF::Locker for locking BaseAudioContext's graph lock https://bugs.webkit.org/show_bug.cgi?id=225935 Reviewed by Sam Weinig. Source/WebCore: Use WTF::Locker for locking BaseAudioContext's graph lock instead of our own AutoLocker. Also use WTF::RecursiveLock instead of duplicating the recursive locking logic inside BaseAudioContext. This means we no longer need lock() / tryLock() / unlock() functions on BaseAudioContext. We now expose the BaseAudioContext's RecursiveLock via a graphLock() getter and the caller sites can just use a Locker. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::enableOutputsIfNecessary): (WebCore::AudioNode::decrementConnectionCount): (WebCore::AudioNode::deref): * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::uninitialize): (WebCore::BaseAudioContext::refSourceNode): (WebCore::BaseAudioContext::addDeferredDecrementConnectionCount): (WebCore::BaseAudioContext::handlePreRenderTasks): (WebCore::BaseAudioContext::outputPosition): (WebCore::BaseAudioContext::handlePostRenderTasks): (WebCore::BaseAudioContext::deleteMarkedNodes): (WebCore::BaseAudioContext::removeMarkedSummingJunction): (WebCore::BaseAudioContext::handleDirtyAudioSummingJunctions): (WebCore::BaseAudioContext::handleDirtyAudioNodeOutputs): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::graphLock): (WebCore::BaseAudioContext::isGraphOwner const): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::setBuffer): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::setFormat): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::setFormat): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::suspendRendering): (WebCore::OfflineAudioContext::shouldSuspend): (WebCore::OfflineAudioContext::didSuspendRendering): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::setOversample): Source/WTF: * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::isOwner const): Add isOwner() function that returns true if the current thread is holding the lock. This is needed for WebAudio purposes. Canonical link: https://commits.webkit.org/237890@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 01:51:47 +00:00
bool isOwner() const { return m_owner == &Thread::current(); }
private:
WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. Source/JavaScriptCore: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): * runtime/ExceptionScope.cpp: (JSC::ExceptionScope::unexpectedExceptionMessage): * runtime/JSLock.h: (JSC::JSLock::currentThreadIsHoldingLock): * runtime/VM.cpp: (JSC::VM::throwException): * runtime/VM.h: (JSC::VM::throwingThread const): (JSC::VM::clearException): * tools/HeapVerifier.cpp: (JSC::HeapVerifier::printVerificationHeader): Source/WebCore: No behavior change. * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::originThread const): (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): (WebCore::IDBActiveDOMObject::originThreadID const): Deleted. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::~IDBCursor): (WebCore::IDBCursor::sourcesDeleted const): (WebCore::IDBCursor::transaction const): (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): (WebCore::IDBDatabase::hasPendingActivity const): (WebCore::IDBDatabase::name const): (WebCore::IDBDatabase::version const): (WebCore::IDBDatabase::objectStoreNames const): (WebCore::IDBDatabase::renameObjectStore): (WebCore::IDBDatabase::renameIndex): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): (WebCore::IDBDatabase::close): (WebCore::IDBDatabase::connectionToServerLost): (WebCore::IDBDatabase::maybeCloseInServer): (WebCore::IDBDatabase::activeDOMObjectName const): (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): (WebCore::IDBDatabase::stop): (WebCore::IDBDatabase::startVersionChangeTransaction): (WebCore::IDBDatabase::didStartTransaction): (WebCore::IDBDatabase::willCommitTransaction): (WebCore::IDBDatabase::didCommitTransaction): (WebCore::IDBDatabase::willAbortTransaction): (WebCore::IDBDatabase::didAbortTransaction): (WebCore::IDBDatabase::didCommitOrAbortTransaction): (WebCore::IDBDatabase::fireVersionChangeEvent): (WebCore::IDBDatabase::dispatchEvent): (WebCore::IDBDatabase::didCreateIndexInfo): (WebCore::IDBDatabase::didDeleteIndexInfo): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::~IDBIndex): (WebCore::IDBIndex::name const): (WebCore::IDBIndex::setName): (WebCore::IDBIndex::objectStore): (WebCore::IDBIndex::keyPath const): (WebCore::IDBIndex::unique const): (WebCore::IDBIndex::multiEntry const): (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): (WebCore::IDBIndex::markAsDeleted): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::~IDBObjectStore): (WebCore::IDBObjectStore::name const): (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::keyPath const): (WebCore::IDBObjectStore::indexNames const): (WebCore::IDBObjectStore::transaction): (WebCore::IDBObjectStore::autoIncrement const): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): (WebCore::IDBObjectStore::markAsDeleted): (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::dispatchEvent): (WebCore::IDBOpenDBRequest::onSuccess): (WebCore::IDBOpenDBRequest::onUpgradeNeeded): (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): (WebCore::IDBOpenDBRequest::requestCompleted): (WebCore::IDBOpenDBRequest::requestBlocked): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::~IDBRequest): (WebCore:: const): (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::setVersionChangeTransaction): (WebCore::IDBRequest::transaction const): (WebCore::IDBRequest::sourceObjectStoreIdentifier const): (WebCore::IDBRequest::sourceIndexIdentifier const): (WebCore::IDBRequest::requestedObjectStoreRecordType const): (WebCore::IDBRequest::requestedIndexRecordType const): (WebCore::IDBRequest::eventTargetInterface const): (WebCore::IDBRequest::activeDOMObjectName const): (WebCore::IDBRequest::canSuspendForDocumentSuspension const): (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::stop): (WebCore::IDBRequest::enqueueEvent): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): (WebCore::IDBRequest::setResultToUndefined): (WebCore::IDBRequest::resultCursor): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): (WebCore::IDBRequest::completeRequestAndDispatchEvent): (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::objectStoreNames const): (WebCore::IDBTransaction::db): (WebCore::IDBTransaction::error const): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abortDueToFailedRequest): (WebCore::IDBTransaction::transitionedToFinishing): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::activeDOMObjectName const): (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): (WebCore::IDBTransaction::hasPendingActivity const): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::isActive const): (WebCore::IDBTransaction::isFinishedOrFinishing const): (WebCore::IDBTransaction::addRequest): (WebCore::IDBTransaction::removeRequest): (WebCore::IDBTransaction::scheduleOperation): (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::pendingOperationTimerFired): (WebCore::IDBTransaction::operationCompletedOnServer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): (WebCore::IDBTransaction::completedOperationTimerFired): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::commitOnServer): (WebCore::IDBTransaction::finishAbortOrCommit): (WebCore::IDBTransaction::didStart): (WebCore::IDBTransaction::notifyDidAbort): (WebCore::IDBTransaction::didAbort): (WebCore::IDBTransaction::didCommit): (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): (WebCore::IDBTransaction::enqueueEvent): (WebCore::IDBTransaction::dispatchEvent): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::createObjectStoreOnServer): (WebCore::IDBTransaction::didCreateObjectStoreOnServer): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::renameObjectStoreOnServer): (WebCore::IDBTransaction::didRenameObjectStoreOnServer): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::createIndexOnServer): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::renameIndexOnServer): (WebCore::IDBTransaction::didRenameIndexOnServer): (WebCore::IDBTransaction::requestOpenCursor): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::openCursorOnServer): (WebCore::IDBTransaction::didOpenCursorOnServer): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::iterateCursorOnServer): (WebCore::IDBTransaction::didIterateCursorOnServer): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::getAllRecordsOnServer): (WebCore::IDBTransaction::didGetAllRecordsOnServer): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestGetValue): (WebCore::IDBTransaction::requestGetKey): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::getRecordOnServer): (WebCore::IDBTransaction::didGetRecordOnServer): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::getCountOnServer): (WebCore::IDBTransaction::didGetCountOnServer): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::deleteRecordOnServer): (WebCore::IDBTransaction::didDeleteRecordOnServer): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::clearObjectStoreOnServer): (WebCore::IDBTransaction::didClearObjectStoreOnServer): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::putOrAddOnServer): (WebCore::IDBTransaction::didPutOrAddOnServer): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteObjectStoreOnServer): (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): (WebCore::IDBTransaction::deleteIndex): (WebCore::IDBTransaction::deleteIndexOnServer): (WebCore::IDBTransaction::didDeleteIndexOnServer): (WebCore::IDBTransaction::operationCompletedOnClient): (WebCore::IDBTransaction::establishOnServer): (WebCore::IDBTransaction::activate): (WebCore::IDBTransaction::deactivate): * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::removeItemsMatchingCurrentThread): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::~TransactionOperation): (WebCore::IDBClient::TransactionOperation::perform): (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread): (WebCore::IDBClient::TransactionOperation::transitionToComplete): (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::TransactionOperation::originThread const): (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::lock): (WebCore::AudioContext::tryLock): (WebCore::AudioContext::unlock): (WebCore::AudioContext::isAudioThread const): (WebCore::AudioContext::isGraphOwner const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::setAudioThread): (WebCore::AudioContext::audioThread const): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): (WebCore::DatabaseDetails::thread const): (WebCore::DatabaseDetails::threadID const): Deleted. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThread): (WebCore::DatabaseThread::getThreadID): Deleted. * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::checkAndHandleClosedDatabase): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * page/ResourceUsageOverlay.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::isCurrentThread): * platform/Supplementable.h: (WebCore::Supplementable::provideSupplement): (WebCore::Supplementable::removeSupplement): (WebCore::Supplementable::requireSupplement): (WebCore::Supplementable::Supplementable): Deleted. * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::setNextFireTime): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (): Deleted. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::close): * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::isContextThread const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): * workers/WorkerThread.h: (WebCore::WorkerThread::thread const): (WebCore::WorkerThread::threadID const): Deleted. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): (WebCore::ServiceWorkerContainer::contextIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJob.h: * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::matchFunc): (WebCore::openFunc): (WebCore::initializeXMLParser): (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Source/WebKit: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): Source/WTF: We should use a pointer of WTF::Thread instead of ThreadIdentifier. One problem is that Windows support library uses WTF::createThread, which returns ThreadIdentifier. So we cannot drop ThreadIdentifier in Windows environment. This patch keeps ThreadIdentifier in Windows. * wtf/MainThread.cpp: (WTF::initializeMainThread): (WTF::isMainThread): (WTF::canAccessThreadLocalDataForThread): * wtf/MainThread.h: * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): (WTF::ParkingLot::unparkOne): (WTF::ParkingLot::unparkOneImpl): (WTF::ParkingLot::unparkCount): * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::lock): (WTF::RecursiveLockAdapter::unlock): (WTF::RecursiveLockAdapter::tryLock): * wtf/Threading.cpp: (WTF::Thread::dump const): * wtf/Threading.h: (WTF::Thread::id const): (WTF::Thread::operator==): Deleted. (WTF::Thread::operator!=): Deleted. (WTF::currentThread): Deleted. * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::initializeCurrentTLS): (WTF::Thread::suspend): (WTF::Thread::establishPlatformSpecificHandle): (WTF::Thread::currentID): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::waitForCompletion): (WTF::Thread::suspend): (WTF::Thread::currentDying): * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThread): (WTF::initializeWebThreadPlatform): (WTF::canAccessThreadLocalDataForThread): (WTF::initializeApplicationUIThreadIdentifier): Deleted. (WTF::initializeWebThreadIdentifier): Deleted. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): (runThread): Deleted. (runPthread): Deleted. (testThreadIdentifierMap): Deleted. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ParkingLot.cpp: * TestWebKitAPI/Tests/WTF/Threading.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-04 06:13:05 +00:00
Thread* m_owner { nullptr }; // Use Thread* instead of RefPtr<Thread> since m_owner thread is always alive while m_onwer is set.
unsigned m_recursionCount { 0 };
LockType m_lock;
};
using RecursiveLock = RecursiveLockAdapter<Lock>;
[WTF] Remove StaticLock https://bugs.webkit.org/show_bug.cgi?id=184332 Reviewed by Mark Lam. Source/JavaScriptCore: * API/JSValue.mm: (handerForStructTag): * API/JSVirtualMachine.mm: (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]): (+[JSVMWrapperCache wrapperForJSContextGroupRef:]): * API/glib/JSCVirtualMachine.cpp: (addWrapper): (removeWrapper): * assembler/testmasm.cpp: * b3/air/testair.cpp: * b3/testb3.cpp: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dynbench.cpp: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): * interpreter/CLoopStack.cpp: * parser/SourceProvider.cpp: * profiler/ProfilerDatabase.cpp: * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/IntlObject.cpp: (JSC::numberingSystemsForLocale): * runtime/JSLock.cpp: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::registerForReportAtExit): * runtime/VM.cpp: * wasm/WasmFaultSignalHandler.cpp: Source/WebCore: No behavior change. * Modules/webdatabase/Database.cpp: (WebCore::Database::Database): (WebCore::Database::performOpenAndVerify): (WebCore::Database::closeDatabase): (WebCore::Database::getCachedVersion const): (WebCore::Database::setCachedVersion): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsMutex): * Modules/websockets/WebSocket.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::identifier): (WebCore::CryptoAlgorithmRegistry::name): (WebCore::CryptoAlgorithmRegistry::create): (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): * dom/Node.cpp: * platform/URL.cpp: * platform/graphics/FontCache.cpp: * platform/graphics/MediaPlayer.cpp: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThread.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/curl/CurlContext.cpp: (WebCore::CurlShareHandle::mutexFor): * platform/network/curl/CurlContext.h: * platform/sql/SQLiteDatabaseTracker.cpp: (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount): (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount): * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::newTextCodec): (WebCore::atomicCanonicalTextEncodingName): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThreadCount): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::~WorkerThread): (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads): Source/WebKitLegacy/ios: * WebCoreSupport/WebFixedPositionContent.mm: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: (getDOMWrapper): (addDOMWrapper): (removeDOMWrapper): Source/WebKitLegacy/win: * WebKitQuartzCoreAdditions/CAView.cpp: (WKQCA::CAView::releaseAllD3DResources): * WebLocalizableStrings.cpp: Source/WTF: Now, WTF::StaticLock is `using StaticLock = Lock`. Lock just works in either static storage and dynamic storage. Remove StaticLock and always use Lock. We also remove StaticWordLock and StaticReadWriteLock. And we add WTF::RecursiveLock, which is RecursiveLockAdapter<Lock>. * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/Language.cpp: (WTF::userPreferredLanguages): * wtf/Lock.h: * wtf/MainThread.cpp: (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/ParkingLot.cpp: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/StackStats.h: * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/ThreadingPthreads.cpp: * wtf/ThreadingWin.cpp: * wtf/WordLock.h: * wtf/cf/LanguageCF.cpp: (WTF::languagePreferencesDidChange): (WTF::platformUserPreferredLanguages): * wtf/dtoa.cpp: * wtf/text/AtomicStringImpl.cpp: * wtf/text/StringView.cpp: (WTF::StringView::invalidate): (WTF::StringView::adoptUnderlyingString): (WTF::StringView::setUnderlyingString): * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::Collator): (WTF::Collator::~Collator): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): Tools: * DumpRenderTree/JavaScriptThreading.cpp: Canonical link: https://commits.webkit.org/199887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-05 17:22:21 +00:00
} // namespace WTF
[WTF] Remove StaticLock https://bugs.webkit.org/show_bug.cgi?id=184332 Reviewed by Mark Lam. Source/JavaScriptCore: * API/JSValue.mm: (handerForStructTag): * API/JSVirtualMachine.mm: (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]): (+[JSVMWrapperCache wrapperForJSContextGroupRef:]): * API/glib/JSCVirtualMachine.cpp: (addWrapper): (removeWrapper): * assembler/testmasm.cpp: * b3/air/testair.cpp: * b3/testb3.cpp: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dynbench.cpp: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): * interpreter/CLoopStack.cpp: * parser/SourceProvider.cpp: * profiler/ProfilerDatabase.cpp: * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/IntlObject.cpp: (JSC::numberingSystemsForLocale): * runtime/JSLock.cpp: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::registerForReportAtExit): * runtime/VM.cpp: * wasm/WasmFaultSignalHandler.cpp: Source/WebCore: No behavior change. * Modules/webdatabase/Database.cpp: (WebCore::Database::Database): (WebCore::Database::performOpenAndVerify): (WebCore::Database::closeDatabase): (WebCore::Database::getCachedVersion const): (WebCore::Database::setCachedVersion): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsMutex): * Modules/websockets/WebSocket.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::identifier): (WebCore::CryptoAlgorithmRegistry::name): (WebCore::CryptoAlgorithmRegistry::create): (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): * dom/Node.cpp: * platform/URL.cpp: * platform/graphics/FontCache.cpp: * platform/graphics/MediaPlayer.cpp: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThread.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/curl/CurlContext.cpp: (WebCore::CurlShareHandle::mutexFor): * platform/network/curl/CurlContext.h: * platform/sql/SQLiteDatabaseTracker.cpp: (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount): (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount): * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::newTextCodec): (WebCore::atomicCanonicalTextEncodingName): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThreadCount): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::~WorkerThread): (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads): Source/WebKitLegacy/ios: * WebCoreSupport/WebFixedPositionContent.mm: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: (getDOMWrapper): (addDOMWrapper): (removeDOMWrapper): Source/WebKitLegacy/win: * WebKitQuartzCoreAdditions/CAView.cpp: (WKQCA::CAView::releaseAllD3DResources): * WebLocalizableStrings.cpp: Source/WTF: Now, WTF::StaticLock is `using StaticLock = Lock`. Lock just works in either static storage and dynamic storage. Remove StaticLock and always use Lock. We also remove StaticWordLock and StaticReadWriteLock. And we add WTF::RecursiveLock, which is RecursiveLockAdapter<Lock>. * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/Language.cpp: (WTF::userPreferredLanguages): * wtf/Lock.h: * wtf/MainThread.cpp: (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/ParkingLot.cpp: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/StackStats.h: * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/ThreadingPthreads.cpp: * wtf/ThreadingWin.cpp: * wtf/WordLock.h: * wtf/cf/LanguageCF.cpp: (WTF::languagePreferencesDidChange): (WTF::platformUserPreferredLanguages): * wtf/dtoa.cpp: * wtf/text/AtomicStringImpl.cpp: * wtf/text/StringView.cpp: (WTF::StringView::invalidate): (WTF::StringView::adoptUnderlyingString): (WTF::StringView::setUnderlyingString): * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::Collator): (WTF::Collator::~Collator): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): Tools: * DumpRenderTree/JavaScriptThreading.cpp: Canonical link: https://commits.webkit.org/199887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-05 17:22:21 +00:00
using WTF::RecursiveLock;