summaryrefslogtreecommitdiffstats
path: root/base/lazy_instance.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix data races in LazyInstance<>.dvyukov@google.com2011-05-161-8/+19
| | | | | | | | BUG=82122 Review URL: http://codereview.chromium.org/6997014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85487 0039d316-1c4b-4281-b951-d872f2087c98
* Move platform_thread to base/threading and put in the base namespace. I left abrettw@chromium.org2010-12-311-2/+2
| | | | | | | | | | | stub and "using" declarations in the old location to avoid having to change the entire project at once. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6001010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70342 0039d316-1c4b-4281-b951-d872f2087c98
* ThreadRestrictions: leak the thread local variableevan@chromium.org2010-10-211-1/+2
| | | | | | | | | | LazyInstances are destroyed by the AtExitManager, but we have threads that outlive the AtExitManager that could potentially access this. Review URL: http://codereview.chromium.org/3956003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63410 0039d316-1c4b-4281-b951-d872f2087c98
* Remove test isolation enforcement code.phajdan.jr@chromium.org2010-08-161-11/+0
| | | | | | | | | | | | | | | | | | | I think it was a failed experiment, and it only ever worked for base_unittests. This removes some potentially risky code from LazyInstance that was only needed for the test isolation. The lesson from this experiment is that removing singletons works better than trying to make tests work fine even when singletons are overused. TEST=none BUG=12710 Review URL: http://codereview.chromium.org/3127012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56229 0039d316-1c4b-4281-b951-d872f2087c98
* Update dynamic annotations and move them to base/third_partytimurrrr@chromium.org2010-05-141-1/+1
| | | | | | Review URL: http://codereview.chromium.org/1992005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47252 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid a strict aliasing issue in LazyInstance.craig.schlenter@chromium.org2010-03-121-20/+23
| | | | | | | | | | | | The key change here is to use the return value from placement new rather than casting buf_. Avoiding the cast avoids the strict aliasing issue. BUG=28749 Review URL: http://codereview.chromium.org/548011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41434 0039d316-1c4b-4281-b951-d872f2087c98
* Isolate tests by running AtExit callbacks between them.phajdan.jr@chromium.org2009-11-191-1/+13
| | | | | | | | | | | | | | | | | | | | For now, this is only for base_unittests. The plan is to enable it for all unit tests. This should finally fix mysterious problems cause by Singletons surviving after one test etc. This change also adapts LazyInstance so that it can be reused after being destroyed. It is used very frequently, for example each time a MessageLoop is used. It is also worth noting that we had some problems in the past related to the MessageLoop being destroyed and re-instantiated in the same test executable. This patch should also fix that. TEST=none BUG=12710 Review URL: http://codereview.chromium.org/372057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32507 0039d316-1c4b-4281-b951-d872f2087c98
* Added dynamic annotation files into base/.deanm@chromium.org2009-06-261-0/+5
| | | | | | | | | | | | | | Added annotations for atomic reference counting, LazyInstance and Singleton classes. This changelist is a part of an effort of adding ThreadSanitizer support for Chromium. See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer Patch by Timur Iskhodzhanov. Review URL: http://codereview.chromium.org/147008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19353 0039d316-1c4b-4281-b951-d872f2087c98
* Create a LazyInstance abstraction for avoiding static constructors by lazily ↵deanm@google.com2008-09-081-0/+34
creating an instance of an object on first access. This is like Singleton, but without the Singleton property of sharing instances. This also preallocates space for the object to avoid the heap to try to help fragmentation and creation performance. Review URL: http://codereview.chromium.org/1608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1837 0039d316-1c4b-4281-b951-d872f2087c98