Chromium Code Reviews
Help | Chromium Project | Sign in
(5)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 1 month ago by Philippe
Modified:
2 years, 1 month ago
CC:
v8-dev_googlegroups.com, 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) Lint Patch
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments ? errors Download
A src/lazy-instance.h View 1 2 1 chunk +216 lines, -0 lines 0 comments 2 errors Download
A src/once.h View 1 2 1 chunk +123 lines, -0 lines 0 comments 2 errors Download
A src/once.cc View 1 2 1 chunk +77 lines, -0 lines 0 comments 5 errors Download
M tools/gyp/v8.gyp View 2 chunks +3 lines, -0 lines 0 comments ? errors Download
Trybot results:
Commit:

Messages

Total messages: 6
Philippe
2 years, 1 month ago #1
fschneider
Still LGTM.
2 years, 1 month ago #2
Dmitry Vyukov
LGTM
2 years, 1 month ago #3
jbates
lgtm
2 years, 1 month ago #4
Philippe
On 2012/02/24 17:31:56, jbates wrote: > lgtm I uploaded a new patch set. The previous ...
2 years, 1 month ago #5
Philippe
2 years, 1 month ago #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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6