Chromium Code Reviews

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

Created:
8 years, 10 months ago by Philippe
Modified:
8 years, 9 months ago
Reviewers:
fschneider, jbates, Dmitry Vyukov
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 Stats (+420 lines, -0 lines)
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments
A src/lazy-instance.h View 1 chunk +216 lines, -0 lines 0 comments
A src/once.h View 1 chunk +123 lines, -0 lines 0 comments
A src/once.cc View 1 chunk +77 lines, -0 lines 0 comments
M tools/gyp/v8.gyp View 2 chunks +3 lines, -0 lines 0 comments

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