DescriptionAdd CallOnce() and simple LazyInstance implementation.
The next CL that will remove static initializers depends on this change.
A few notes:
- callback.h comes from Protocol Buffers.
- This implementation of LazyInstance does not handle global destructors (i.e. the lazy instances are never deleted). Let me know if this is an issue.
- A CL adding a similar implementation of CallOnce() (based on a patch sent by Digit) will be sent for review to the Protobuf team very soon.
BUG=1859
Patch Set 1 #Patch Set 2 : Update #Patch Set 3 : Add comments and remove heap allocation in lazy_instance.h #Patch Set 4 : Rename GoogleOnceInit to CallOnce #
Total comments: 24
Patch Set 5 : Improve CallOnce() and LazyInstance #
Total comments: 14
Patch Set 6 : Fix memory barrier issue #
Total comments: 2
Patch Set 7 : Reduce callback.h, update SConscript and lint #Patch Set 8 : Rebase against bleeding_edge #
Total comments: 1
Patch Set 9 : Remove callback.h #
MessagesTotal messages: 13
|