DescriptionFix WaitForTypeEncryption race condition
IsTypeEncrypted() and IsSynced() are both changed when by a
WriteTransaction on the syncer thread. When IsTypeEncrytped() gets
toggled from false to true, that should imply that IsSynced() is false
(at least until a sync cycle comes along and commits the changes to
the server).
Sometimes the thread executing this code will see the value of IsSynced()
before the transaction (true) and IsTypeEncrypted after the transaction
(true). This is bad, because we end up inside the if branch when
IsSynced() is false, which is not the intent of this code.
A proper fix might involve wrapping the entire if condition in a
ReadTrasaction. An easier fix is to swap the order in which the
conditions are evaluated, and that's what this commit does.
BUG=95619
TEST=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=100186
Patch Set 1 #
Total comments: 2
Messages
Total messages: 7 (0 generated)
|