summaryrefslogtreecommitdiffstats
path: root/base/thread_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Header cleanup in base.brettw@chromium.org2010-08-171-1/+0
| | | | | | | | | | | | | | This makes uses of StringPrintf and friends use the base namespace and include stringprintf.h explicitly. This also removes a bunch of unnecessary string_util includes (which exposed a few other errors like people forgetting to include <vector>. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3119022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56446 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
* Add a Thread::CleanUpAfterMessageLoopDestruction() method which gets called ↵eroman@chromium.org2010-04-141-1/+120
| | | | | | | | | | after the message loop has been destroyed. BUG=39723 TEST=ThreadTest.CleanUp Review URL: http://codereview.chromium.org/1593023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44532 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting this CL as it causes chrome frame net tests to crash at exit. The ↵ananta@chromium.org2010-04-131-109/+1
| | | | | | | | | | | | | | | | | | | | | crash happens because the IPC channel proxy code relies on the listener threads message loop being around. This change destroys the message loop when it goes out of scope leading to the crash. Revert 44323 - Don't call Thread::CleanUp() before the MessageLoop destruction observers have run. This is consistent with the comment for Thread::CleanUp(), which says it runs after the message loop has "stopped". Certain consumers depend on this ordering to avoid accessing variables which are deleted by Thread::CleanUp(). BUG=39723 TEST=ThreadTest.CleanUp Review URL: http://codereview.chromium.org/1540002 TBR=eroman@chromium.org Review URL: http://codereview.chromium.org/1528034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44357 0039d316-1c4b-4281-b951-d872f2087c98
* Don't call Thread::CleanUp() before the MessageLoop destruction observers ↵eroman@chromium.org2010-04-131-1/+109
| | | | | | | | | | | | | have run. This is consistent with the comment for Thread::CleanUp(), which says it runs after the message loop has "stopped". Certain consumers depend on this ordering to avoid accessing variables which are deleted by Thread::CleanUp(). BUG=39723 TEST=ThreadTest.CleanUp Review URL: http://codereview.chromium.org/1540002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44323 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 43127 [It resulted in a free memory write because of a consumer that ↵eroman@chromium.org2010-03-311-109/+1
| | | | | | | | | | | | | | | | | | | was relying on the old ordering (BUG=39932).] Don't call Thread::CleanUp() before the MessageLoop destruction observers have run. This is consistent with the comment for Thread::CleanUp(), which says it runs after the message loop has "stopped". Certain consumers depend on this ordering to avoid accessing variables which are deleted by Thread::CleanUp(). BUG=39723 TEST=ThreadTest.CleanUp Review URL: http://codereview.chromium.org/1540002 TBR=eroman@chromium.org Review URL: http://codereview.chromium.org/1517006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43174 0039d316-1c4b-4281-b951-d872f2087c98
* Don't call Thread::CleanUp() before the MessageLoop destruction observers ↵eroman@chromium.org2010-03-301-1/+109
| | | | | | | | | | | | | | have run. This is consistent with the comment for Thread::CleanUp(), which says it runs after the message loop has "stopped". Certain consumers depend on this ordering to avoid accessing variables which are deleted by Thread::CleanUp(). BUG=39723 TEST=ThreadTest.CleanUp Review URL: http://codereview.chromium.org/1540002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43127 0039d316-1c4b-4281-b951-d872f2087c98
* Annotate a test-only data race on booleantimurrrr@chromium.org2009-12-021-0/+3
| | | | | | | | | We had a suppression for this race, but it couldn't hide the race in some rare cases like http://build.chromium.org/buildbot/waterfall/builders/Linux Tests (tsan)/builds/1213/steps/valgrind test%3A base/logs/stdio when the order of the racing accesses was different. Review URL: http://codereview.chromium.org/466009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33603 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* Implementation of Pipeline and FilterHost interfaces. This is a large ↵ralphl@chromium.org2009-01-281-0/+9
| | | | | | | | | | | | change, but all of the objects are interrelated. I am also checking in a basic unit test that creates pipeline, and the data source hangs during initialization. The test sleeps one second and then stops the pipeline. Andrew has already done a first pass on this, and the code has come largely from our working experimental branch. Review URL: http://codereview.chromium.org/18546 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8805 0039d316-1c4b-4281-b951-d872f2087c98
* Moved Init() before startup_data_->event.Signal() because derivedjrg@chromium.org2009-01-271-0/+23
| | | | | | | | | | | | | | | classes may not be safe to use until Init() has been called. As an example, RenderThread() creates it's IPC::SyncChannel in Init(), so it isn't safe to call Send() method until after. Update use of a Thread (hit with ui_tests) to no longer require Init() be called after the startup event is signaled (required old thread behavior). Ran a bunch more tests on Windows to try harder to make sure I didn't break anything. Review URL: http://codereview.chromium.org/18824 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8695 0039d316-1c4b-4281-b951-d872f2087c98
* Review URL: http://codereview.chromium.org/18690jrg@chromium.org2009-01-221-23/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8506 0039d316-1c4b-4281-b951-d872f2087c98
* Moved Init() startup_data_->event.Signal() because derived classes mayjrg@chromium.org2009-01-221-0/+23
| | | | | | | | | | | | not be safe to use until Init() has been called. As an example, RenderThread() creates it's IPC::SyncChannel in Init(), so it isn't safe to call Send() method until after. Change tested explicitly on Mac Win Linux. Review URL: http://codereview.chromium.org/18508 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8485 0039d316-1c4b-4281-b951-d872f2087c98
* * Cleanup: move base/platform_test.h -> testing/jeremy@chromium.org2008-12-021-1/+1
| | | | | | | | * Add support for "Debug On Start" switch to MultiprocessTest::SpawnChild Review URL: http://codereview.chromium.org/13052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6227 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply 5971 which was reverted in 5974. The unit test wasn't unregistering ↵maruel@chromium.org2008-12-011-1/+1
| | | | | | | | the observer correctly. Review URL: http://codereview.chromium.org/12474 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6142 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 5971.maruel@chromium.org2008-11-251-1/+1
| | | | | | Review URL: http://codereview.chromium.org/12637 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5974 0039d316-1c4b-4281-b951-d872f2087c98
* Add superficial unit test for PrintJob. That's a start.maruel@chromium.org2008-11-251-1/+1
| | | | | | | | Add more DCHECKs. Same as r5607 except that Thread.StopSoon is fixed. Review URL: http://codereview.chromium.org/11534 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5971 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure Cocoa sets up its multithreaded environmentmmentovai@google.com2008-08-281-6/+8
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1476 0039d316-1c4b-4281-b951-d872f2087c98
* Allow consumers of MessageLoop to specify the type of MessageLoop they want.darin@google.com2008-08-261-2/+6
| | | | | | | | | | | | | | | | This CL introduces a Type enum to MessageLoop, and I also created subclasses of MessageLoop corresponding to the non-default types: MessageLoopForIO and MessageLoopForUI. I moved all of the platform-specific MessageLoop APIs onto either MessageLoopForIO or MessageLoopForUI. MessageLoopForIO gets the Watcher API, and MessageLoopForUI gets the Observer and Dispatcher APIs. Under the hood, both are implemented in terms of MessagePumpWin, but that will change in a future CL. The Thread class is changed to allow the consumer to specify the Type of MessageLoop they want to have setup on the created thread. I re-organized message_loop_unittest.cc and timer_unittest.cc so that I could exercise all (or most) of the tests against each type of MessageLoop. Note: I know that "explicit MessageLoop(Type type = TYPE_DEFAULT);" is in violation to the style-guide's restriction against default arguments. I'm working on finding a decent solution to that problem. Please ignore this issue for now. The corresponding chrome/ changes are coming in a separate CL due to Reitveld data size limitations. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1362 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Port the Thread class properly to Mac and Linux. This involved portingdarin@google.com2008-08-211-2/+2
| | | | | | | | | | | | PlatformThread and creating an API on PlatformThread to create a native thread and later join with it. I also made a few other tweaks to PlatformThread, such as eliminating the Current() method which appears to be unused. The operator==() is also unused, so I killed it as well. I made a few other miscellaneous cleanups and adjustments. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1146 0039d316-1c4b-4281-b951-d872f2087c98
* - Add Thread::StopSoon() and remove Thread::NonBlockingStop(). StopSoon() ↵maruel@google.com2008-08-121-65/+35
| | | | | | | | | | | | can't be implemented externally of the Thread class where NonBlockingStop() was really just an helper function solely used in printing. - Move two member functions access from public to protected. - Add documentation about which thread modifies which member variable. - Simplify ThreadStartInfo. This removes one heap allocation. - Improve unit test coverage. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@728 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+157
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98