Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: Source/modules/webdatabase/DatabaseBackendBase.cpp

Issue 415083002: [oilpan]: fix deadlock when leaving a safepoint and sweeping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review feedback Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webdatabase/DatabaseBackendBase.cpp
diff --git a/Source/modules/webdatabase/DatabaseBackendBase.cpp b/Source/modules/webdatabase/DatabaseBackendBase.cpp
index 034db9a1abe4100e8a7d73c4a4193cd2778f70e1..b234b7c3ed037378b7bcee0c8d6e0ce62c496f21 100644
--- a/Source/modules/webdatabase/DatabaseBackendBase.cpp
+++ b/Source/modules/webdatabase/DatabaseBackendBase.cpp
@@ -135,9 +135,9 @@ static bool setTextValueInDatabase(SQLiteDatabase& db, const String& query, cons
}
// FIXME: move all guid-related functions to a DatabaseVersionTracker class.
-static Mutex& guidMutex()
+static RecursiveMutex& guidMutex()
{
- AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
+ AtomicallyInitializedStatic(RecursiveMutex&, mutex = *new RecursiveMutex);
return mutex;
}
@@ -145,7 +145,7 @@ typedef HashMap<DatabaseGuid, String> GuidVersionMap;
static GuidVersionMap& guidToVersionMap()
{
// Ensure the the mutex is locked.
- ASSERT(!guidMutex().tryLock());
+ ASSERT(guidMutex().locked());
DEFINE_STATIC_LOCAL(GuidVersionMap, map, ());
return map;
}
@@ -154,7 +154,7 @@ static GuidVersionMap& guidToVersionMap()
static inline void updateGuidVersionMap(DatabaseGuid guid, String newVersion)
{
// Ensure the the mutex is locked.
- ASSERT(!guidMutex().tryLock());
+ ASSERT(guidMutex().locked());
// Note: It is not safe to put an empty string into the guidToVersionMap() map.
// That's because the map is cross-thread, but empty strings are per-thread.
@@ -170,7 +170,7 @@ typedef HashMap<DatabaseGuid, HashSet<DatabaseBackendBase*>*> GuidDatabaseMap;
static GuidDatabaseMap& guidToDatabaseMap()
{
// Ensure the the mutex is locked.
- ASSERT(!guidMutex().tryLock());
+ ASSERT(guidMutex().locked());
DEFINE_STATIC_LOCAL(GuidDatabaseMap, map, ());
return map;
}
@@ -178,7 +178,7 @@ static GuidDatabaseMap& guidToDatabaseMap()
static DatabaseGuid guidForOriginAndName(const String& origin, const String& name)
{
// Ensure the the mutex is locked.
- ASSERT(!guidMutex().tryLock());
+ ASSERT(guidMutex().locked());
String stringID = origin + "/" + name;
« no previous file with comments | « no previous file | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698