diff options
author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 07:02:22 +0000 |
---|---|---|
committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 07:02:22 +0000 |
commit | ddf5b51625c2b564b27c53886111b836492b0403 (patch) | |
tree | 3ffba72fb2091fdad345b6e28dd89b7ad6136900 /base/process_util.h | |
parent | 73a087f880e0d18557b5c44630e0f4f68541c2b9 (diff) | |
download | chromium_src-ddf5b51625c2b564b27c53886111b836492b0403.zip chromium_src-ddf5b51625c2b564b27c53886111b836492b0403.tar.gz chromium_src-ddf5b51625c2b564b27c53886111b836492b0403.tar.bz2 |
base: add GetNumberOfThreads() to Linux and Android.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/12193017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r-- | base/process_util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/base/process_util.h b/base/process_util.h index fe21adf..10d3028 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -197,6 +197,12 @@ BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process); // Exposed for testing. BASE_EXPORT int ParseProcStatCPU(const std::string& input); +// Get the number of threads of |process| as available in /proc/<pid>/stat. +// This should be used with care as no synchronization with running threads is +// done. This is mostly useful to guarantee being single-threaded. +// Returns 0 on failure. +BASE_EXPORT int GetNumberOfThreads(ProcessHandle process); + // The maximum allowed value for the OOM score. const int kMaxOomScore = 1000; |