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

Issue 488012: Use a ConditionVariable in place of WaitableEvent in BookmarkModelWorker.... (Closed)

Created:
11 years ago by tim (not reviewing)
Modified:
9 years, 6 months ago
Reviewers:
Timur Iskhodzhanov
CC:
chromium-reviews_googlegroups.com, ncarter (slow), ben+cc_chromium.org, tim (not reviewing), idana
Visibility:
Public.

Description

Use a ConditionVariable in place of WaitableEvent in BookmarkModelWorker. This is to ensure future changes to the code don't introduce harmful races that could arise in presence of compiler optimizations due to the lack of a barrier permitting instruction re-ordering. The theoretical race that exists now isn't causing any real malfunction today, but is causing ThreadSanitizer warnings. BUG=25915 TEST=BookmarkModelWorkerTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34558

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : comment retweak #

Patch Set 4 : mac/linux compile #

Total comments: 5

Patch Set 5 : updates from comments #

Patch Set 6 : '' #

Total comments: 2

Patch Set 7 : updates from comments 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -18 lines) Patch
M chrome/browser/sync/glue/bookmark_model_worker.h View 1 2 3 4 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_model_worker.cc View 1 2 3 4 5 6 3 chunks +12 lines, -15 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
tim (not reviewing)
11 years ago (2009-12-14 17:42:19 UTC) #1
Timur Iskhodzhanov
http://codereview.chromium.org/488012/diff/2004/5001 File chrome/browser/sync/glue/bookmark_model_worker.cc (right): http://codereview.chromium.org/488012/diff/2004/5001#newcode75 chrome/browser/sync/glue/bookmark_model_worker.cc:75: syncapi_event_.Wait(); Are there any problems with having Wait() at ...
11 years ago (2009-12-14 17:53:42 UTC) #2
tim (not reviewing)
http://codereview.chromium.org/488012/diff/2004/5001 File chrome/browser/sync/glue/bookmark_model_worker.cc (right): http://codereview.chromium.org/488012/diff/2004/5001#newcode75 chrome/browser/sync/glue/bookmark_model_worker.cc:75: syncapi_event_.Wait(); On 2009/12/14 17:53:42, Timur Iskhodzhanov wrote: > Are ...
11 years ago (2009-12-14 19:41:32 UTC) #3
Timur Iskhodzhanov
http://codereview.chromium.org/488012/diff/2004/5001 File chrome/browser/sync/glue/bookmark_model_worker.cc (right): http://codereview.chromium.org/488012/diff/2004/5001#newcode78 chrome/browser/sync/glue/bookmark_model_worker.cc:78: pending_work_->Run(); Ah, ok On 2009/12/14 19:41:32, timsteele wrote: > ...
11 years ago (2009-12-14 19:54:58 UTC) #4
tim (not reviewing)
http://codereview.chromium.org/488012/diff/3005/3006 File chrome/browser/sync/glue/bookmark_model_worker.cc (right): http://codereview.chromium.org/488012/diff/3005/3006#newcode77 chrome/browser/sync/glue/bookmark_model_worker.cc:77: while (pending_work_ == NULL && !syncapi_has_shutdown_) On 2009/12/14 19:54:59, ...
11 years ago (2009-12-14 21:09:36 UTC) #5
Timur Iskhodzhanov
11 years ago (2009-12-14 21:17:39 UTC) #6
LGTM
On 2009/12/14 21:09:36, timsteele wrote:
> http://codereview.chromium.org/488012/diff/3005/3006
> File chrome/browser/sync/glue/bookmark_model_worker.cc (right):
> 
> http://codereview.chromium.org/488012/diff/3005/3006#newcode77
> chrome/browser/sync/glue/bookmark_model_worker.cc:77: while (pending_work_ ==
> NULL && !syncapi_has_shutdown_)
> On 2009/12/14 19:54:59, Timur Iskhodzhanov wrote:
> > Do you need the nested while loop?
> I felt what we were waiting on was more explicit this way.  I guess it's not
> helping :)  Changed.

Powered by Google App Engine
This is Rietveld 408576698