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

Unified Diff: chrome/browser/sync/syncable/syncable.cc

Issue 2854059: Merge 53223 - Fix deadlock by introducing a new transaction event.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 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 | « chrome/browser/sync/syncable/syncable.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/syncable.cc
===================================================================
--- chrome/browser/sync/syncable/syncable.cc (revision 53274)
+++ chrome/browser/sync/syncable/syncable.cc (working copy)
@@ -960,6 +960,8 @@
Lock();
}
+BaseTransaction::~BaseTransaction() {}
+
void BaseTransaction::UnlockAndLog(OriginalEntries* originals_arg) {
dirkernel_->transaction_mutex.AssertAcquired();
@@ -982,8 +984,17 @@
originals.get(), this, writer_ };
dirkernel_->changes_channel.Notify(event);
+ // Necessary for reads to be performed prior to transaction mutex release.
+ // Allows the listener to use the current transaction to perform reads.
+ DirectoryChangeEvent ending_event =
+ { DirectoryChangeEvent::TRANSACTION_ENDING,
+ NULL, this, INVALID };
+ dirkernel_->changes_channel.Notify(ending_event);
+
dirkernel_->transaction_mutex.Release();
+ // Directly after transaction mutex release, but lock on changes channel.
+ // You cannot be re-entrant to a transaction in this handler.
DirectoryChangeEvent complete_event =
{ DirectoryChangeEvent::TRANSACTION_COMPLETE,
NULL, NULL, INVALID };
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698