summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/threading/platform_thread_posix.cc8
-rw-r--r--base/threading/thread.cc5
2 files changed, 12 insertions, 1 deletions
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 44b691c..8e3f365 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -13,6 +13,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread_internal_posix.h"
#include "base/threading/thread_id_name_manager.h"
@@ -126,8 +127,13 @@ bool CreateThread(size_t stack_size, bool joinable,
// Don't let this call complete until the thread id
// is set in the handle.
- if (success)
+ if (success) {
+ // TODO(toyoshim): Remove this after a few days (crbug.com/495097)
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "495097 pthread_create and handle_set.Wait"));
params.handle_set.Wait();
+ }
CHECK_EQ(handle, thread_handle->platform_handle());
return success;
diff --git a/base/threading/thread.cc b/base/threading/thread.cc
index 900b1a5..f7d938c 100644
--- a/base/threading/thread.cc
+++ b/base/threading/thread.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "base/location.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/synchronization/waitable_event.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/threading/thread_id_name_manager.h"
@@ -179,6 +180,10 @@ void Thread::StopSoon() {
PlatformThreadId Thread::GetThreadId() const {
// If the thread is created but not started yet, wait for |id_| being ready.
base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ // TODO(toyoshim): Remove this after a few days (crbug.com/495097)
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "495097 base::Thread::GetThreadId"));
id_event_.Wait();
return id_;
}