[Webkit-unassigned] [Bug 25711] HTML5 Database becomes locked if a transaction is in progress when the page is refreshed.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 30 12:02:00 PDT 2009


------- Comment #30 from benm at google.com  2009-06-30 12:01 PDT -------
(In reply to comment #29)
> Is the Mutex really needed? Can it be replaced with ASSERT(isDatabaseThread())?
> I think the db should always be opened/close on the db thread, that looks like
> the intent of things, why not assert it.
> The code right now looks like it depends on being able to reenter the mutex
> since the loop at thread end locks it and the db.close method will also grab
> the lock. Is WTF::Mutex reentrant on all platforms?

Thanks for the review Michael. It seems that the platform mutexes are not
guaranteed to be recursive so this strategy isn't going to work. After some
discussion I've decided to move the code for tracking the databases currently
opened on a particular thread into the DatabaseTracker (which seems an
appropriate place :)). The tracker now has a hash map of thread -> DatabaseSet
and whenever a database is added/removed from the tracker I update this set
too. I added a new function on the tracker that iterates this map for a given
database thread and executes the close. I call that function just before the
database thread exits.

Patch is on the way!

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list