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

Issue 9447052: Add CallOnce() and simple LazyInstance implementation. (Closed)

Created:
8 years, 10 months ago by Philippe
Modified:
8 years, 9 months ago
CC:
v8-dev, digit
Visibility:
Public.

Description

Add CallOnce() and simple LazyInstance implementation. Note that this implementation of LazyInstance does not handle global destructors (i.e. the lazy instances are never deleted). This CL was initially reviewed on codereview.appspot.com: http://codereview.appspot.com/5687064/ BUG=1859

Patch Set 1 #

Patch Set 2 : Fix out-dated if statements in once.h #

Patch Set 3 : Lint. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+420 lines, -0 lines) Patch
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
A src/lazy-instance.h View 1 2 1 chunk +216 lines, -0 lines 0 comments Download
A src/once.h View 1 2 1 chunk +123 lines, -0 lines 0 comments Download
A src/once.cc View 1 2 1 chunk +77 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Philippe
8 years, 10 months ago (2012-02-24 11:57:35 UTC) #1
fschneider
Still LGTM.
8 years, 10 months ago (2012-02-24 12:01:00 UTC) #2
Dmitry Vyukov
LGTM
8 years, 10 months ago (2012-02-24 12:09:32 UTC) #3
jbates
lgtm
8 years, 10 months ago (2012-02-24 17:31:56 UTC) #4
Philippe
On 2012/02/24 17:31:56, jbates wrote: > lgtm I uploaded a new patch set. The previous ...
8 years, 10 months ago (2012-02-27 10:15:36 UTC) #5
Philippe
8 years, 10 months ago (2012-02-27 14:07:38 UTC) #6
On 2012/02/27 10:15:36, Philippe wrote:
> On 2012/02/24 17:31:56, jbates wrote:
> > lgtm
> 
> I uploaded a new patch set. The previous if statements in CallOnce(), in
once.h
> were out-dated.
> The atomic word visible in the header was initially used as a boolean.
> Now it has three states, therefore the condition could be satisfied while the
> initialization function was still running (state = 1) which was obviously a
bug.

I had to introduce some typedefs to make presubmit.py pass. Cpplint does not
like function pointer syntax in function arguments.

Powered by Google App Engine
This is Rietveld 408576698