diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 19:14:34 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 19:14:34 +0000 |
commit | 45e7926f368fcf97709fb1abd02dd1a981245802 (patch) | |
tree | b99df85e480580c8ff755d52bf9f1c56e9c5c108 /base/logging.cc | |
parent | 54e554f4155c98bdfd4a3efd03eb0164ce3ea873 (diff) | |
download | chromium_src-45e7926f368fcf97709fb1abd02dd1a981245802.zip chromium_src-45e7926f368fcf97709fb1abd02dd1a981245802.tar.gz chromium_src-45e7926f368fcf97709fb1abd02dd1a981245802.tar.bz2 |
Temporarily revert 117127 for perf analysis.
BUG=110555
TBR=rsesek@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9252014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/logging.cc')
-rw-r--r-- | base/logging.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/base/logging.cc b/base/logging.cc index 1a51312..149bdda 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -51,7 +51,6 @@ typedef pthread_mutex_t* MutexHandle; #include "base/eintr_wrapper.h" #include "base/string_piece.h" #include "base/synchronization/lock_impl.h" -#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "base/vlog.h" #if defined(OS_POSIX) @@ -130,6 +129,22 @@ int32 CurrentProcessId() { #endif } +int32 CurrentThreadId() { +#if defined(OS_WIN) + return GetCurrentThreadId(); +#elif defined(OS_MACOSX) + return mach_thread_self(); +#elif defined(OS_LINUX) + return syscall(__NR_gettid); +#elif defined(OS_ANDROID) + return gettid(); +#elif defined(OS_NACL) + return pthread_self(); +#elif defined(OS_POSIX) + return reinterpret_cast<int64>(pthread_self()); +#endif +} + uint64 TickCount() { #if defined(OS_WIN) return GetTickCount(); @@ -675,7 +690,7 @@ void LogMessage::Init(const char* file, int line) { if (log_process_id) stream_ << CurrentProcessId() << ':'; if (log_thread_id) - stream_ << base::PlatformThread::CurrentId() << ':'; + stream_ << CurrentThreadId() << ':'; if (log_timestamp) { time_t t = time(NULL); struct tm local_time = {0}; |