summaryrefslogtreecommitdiffstats
path: root/base/platform_thread_posix.cc
Commit message (Collapse)AuthorAgeFilesLines
* Reland r68893 after fixing allowing blocking IO on shutdown.willchan@chromium.org2010-12-141-0/+4
| | | | | | | | | | | | | | | | | | This time I just turned off the checking for Chrome/Windows because Chrome/Windows shutdown is a clusterf***. TODO(willchan): Give a shit about Windows, get a machine that runs Windows, debug Chrome shutdown on Windows, enable this ThreadRestrictions for Chrome/Windows. Consider PlatformThread::Join() to be blocking IO. Marks PlatformThread::Join() as blocking IO using ThreadRestrictions. Whitelists existing spots where we join on the UI/IO threads. Also noteworthy is I allow blocking IO on shutdown. BUG=65530, 66077, 66082 TEST=existing Review URL: http://codereview.chromium.org/5750003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69079 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 68893 - Consider PlatformThread::Join() to be blocking IO.csilv@chromium.org2010-12-111-4/+0
| | | | | | | | | | | | | | | | | Marks PlatformThread::Join() as blocking IO using ThreadRestrictions. Whitelists existing spots where we join on the UI/IO threads. Also noteworthy is I allow blocking IO on shutdown. BUG=65530,66077,66082 TEST=none Review URL: http://codereview.chromium.org/5693003 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5743005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68915 0039d316-1c4b-4281-b951-d872f2087c98
* Consider PlatformThread::Join() to be blocking IO.willchan@chromium.org2010-12-101-0/+4
| | | | | | | | | | | | | | Marks PlatformThread::Join() as blocking IO using ThreadRestrictions. Whitelists existing spots where we join on the UI/IO threads. Also noteworthy is I allow blocking IO on shutdown. BUG=65530,66077,66082 TEST=none Review URL: http://codereview.chromium.org/5693003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68893 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 66791 (change was innocent)willchan@chromium.org2010-11-191-7/+26
| | | | | | | | | | | | | | | | | | | Revert 66719 - Reland r65996. Disallows Singletons on non-joinable thread. Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5206005 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5242002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66808 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 66719 - Reland r65996. Disallows Singletons on non-joinable thread.willchan@chromium.org2010-11-191-26/+7
| | | | | | | | | | | | | | Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5206005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66791 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r65996. Disallows Singletons on non-joinable thread.willchan@chromium.org2010-11-191-7/+26
| | | | | | | | | | | Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66719 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 65996 (test breakage) - Disallow Singleton and LazyInstance on ↵willchan@chromium.org2010-11-131-26/+7
| | | | | | | | | | | | | | | | non-joinable threads. Fix all known instances or explicitly allow them. Usually the fix involves switching from Default traits to Lazy traits. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/4635012 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/4980001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66071 0039d316-1c4b-4281-b951-d872f2087c98
* Disallow Singleton and LazyInstance on non-joinable threads.willchan@chromium.org2010-11-121-7/+26
| | | | | | | | | | | Fix all known instances or explicitly allow them. Usually the fix involves switching from Default traits to Lazy traits. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/4635012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65996 0039d316-1c4b-4281-b951-d872f2087c98
* NaCl bringup of base.abarth@chromium.org2010-11-121-1/+7
| | | | | | | | | | We need to include nacl_syscalls.h for nanosleep. Original patch by Eric Seidel. Review URL: http://codereview.chromium.org/4812003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65960 0039d316-1c4b-4281-b951-d872f2087c98
* posix: set thread namesevan@chromium.org2010-06-101-8/+50
| | | | | | | | | | | | | | | | There's a non-portable function for doing this: pthread_setname_np. It's supported by OS X >= 10.6 and the Xcode debugger will show the thread names if they're provided. On Linux, support has just recently been added to glibc for the same function. Since OS coverage of the function is so spotty, we look for the symbol at runtime; on Linux we fall back to another implementation of the same functionality if the function isn't available. [reland of r49212, with Mac fixed and Linux disabled; see comments in code as to why Linux is disabled] Review URL: http://codereview.chromium.org/2774001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49465 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "posix: set thread names"evan@chromium.org2010-06-081-46/+8
| | | | | | This reverts commit r49212. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49214 0039d316-1c4b-4281-b951-d872f2087c98
* posix: set thread namesevan@chromium.org2010-06-081-8/+46
| | | | | | | | | | | | | There's a non-portable function for doing this: pthread_setname_np. It's supported by OS X >= 10.6 and the Xcode debugger will show the thread names if they're provided. On Linux, support has just recently been added to glibc for the same function. Since OS coverage of the function is so spotty, we look for the symbol at runtime; on Linux we fall back to another implementation of the same functionality if the function isn't available. Review URL: http://codereview.chromium.org/2774001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49212 0039d316-1c4b-4281-b951-d872f2087c98
* Use a reasonable default pthread stack size on Mac OS X.mark@chromium.org2010-05-071-0/+33
| | | | | | | | | | | | | Mac OS X uses a fixed default stack size of 512kB, which is too small for some purposes. glibc on Linux uses ulimit -s, which is both a more reasonable thing to do, and is generally set to a rational limit, such as 8MB. BUG=43422 TEST=None really on the trunk. On the Mac 375 branch, using the .pac file on the bug, Chrome should not crash on startup. Review URL: http://codereview.chromium.org/2035007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46717 0039d316-1c4b-4281-b951-d872f2087c98
* Changes to base/ from a combination of FreeBSD and OpenBSD patches.evan@chromium.org2009-12-291-1/+4
| | | | | | Review URL: http://codereview.chromium.org/495002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35321 0039d316-1c4b-4281-b951-d872f2087c98
* Added a new method CreateNonJoinable() to PlatformThread. Added the windows ↵willchan@chromium.org2009-03-051-5/+28
| | | | | | | | and posix implementations. Review URL: http://codereview.chromium.org/40133 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11053 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-1/+1
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Use PlatformThreadId, not int when dealing with thread ids.agl@chromium.org2009-01-231-1/+1
| | | | | | | | | | | | | | | | | Windows uses a DWORD (unsigned long) for thread ids and POSIX uses a pid_t (int on Linux) for the same. In the code, we are currently stuffing thread ids into an int which is dangerous on Windows (because DWORDS can exceed an int and wrap) and will break if pid_t is ever != int. This change changes all the places where we currently have an int to use a new typedef, PlatformThreadId. This change also needs to occur for process ids, but I'm not doing that in this CL. Review URL: http://codereview.chromium.org/18677 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8525 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure Cocoa sets up its multithreaded environmentmmentovai@google.com2008-08-281-3/+12
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1476 0039d316-1c4b-4281-b951-d872f2087c98
* Updated comment in thread naming.avi@google.com2008-08-251-1/+6
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1308 0039d316-1c4b-4281-b951-d872f2087c98
* Make PlatformThread::SetName operate only on the current thread.deanm@google.com2008-08-251-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1306 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-0/+107
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