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

Issue 3956003: ThreadRestrictions: leak the thread local variable (Closed)

Created:
10 years, 2 months ago by Evan Martin
Modified:
9 years, 7 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

ThreadRestrictions: leak the thread local variable LazyInstances are destroyed by the AtExitManager, but we have threads that outlive the AtExitManager that could potentially access this. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=63410

Patch Set 1 #

Total comments: 1

Patch Set 2 : better impl #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -2 lines) Patch
M base/lazy_instance.h View 1 chunk +16 lines, -0 lines 0 comments Download
M base/lazy_instance.cc View 1 chunk +2 lines, -1 line 0 comments Download
M base/lazy_instance_unittest.cc View 1 chunk +43 lines, -0 lines 1 comment Download
M base/thread_restrictions.cc View 1 1 chunk +2 lines, -1 line 1 comment Download

Messages

Total messages: 4 (0 generated)
Evan Martin
I don't really know what I'm doing, so advice (including what to do about valgrind) ...
10 years, 2 months ago (2010-10-21 18:06:21 UTC) #1
willchan no longer on Chromium
LGTM http://codereview.chromium.org/3956003/diff/1/2 File base/thread_restrictions.cc (right): http://codereview.chromium.org/3956003/diff/1/2#newcode16 base/thread_restrictions.cc:16: struct LeakLazyInstanceTraits { Sounds like you should put ...
10 years, 2 months ago (2010-10-21 19:00:03 UTC) #2
Evan Martin
I did some refactoring to sidestep the AtExitManager requirement. It's a little silly that my ...
10 years, 2 months ago (2010-10-21 19:24:50 UTC) #3
willchan no longer on Chromium
10 years, 2 months ago (2010-10-21 20:26:50 UTC) #4
LGTM, just had some nits which you can address if you want.

http://codereview.chromium.org/3956003/diff/4002/5003
File base/lazy_instance_unittest.cc (right):

http://codereview.chromium.org/3956003/diff/4002/5003#newcode116
base/lazy_instance_unittest.cc:116: }  // anonymous namespace
I actually don't understand why this whole file isn't in an anonymous namespace,
not that it matters too much.

http://codereview.chromium.org/3956003/diff/4002/5004
File base/thread_restrictions.cc (right):

http://codereview.chromium.org/3956003/diff/4002/5004#newcode16
base/thread_restrictions.cc:16: base::LazyInstance<base::ThreadLocalBoolean,
Why don't you just move this anonymous namespace within the base namespace, then
you can get rid of all the base:: which should make this a bit prettier.

Powered by Google App Engine
This is Rietveld 408576698