Commit b919ff20 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Avoid collecting meaningless ScopedBlockingCall trace events

The call to base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope and
to WaitableEvent::wait(...) are generating trace events that are not
useful after the thread_id is set. Since it's only done at thread
creation, it cannot blocked otherwise and there is no point to get
a ScopedBlockingCall trace events.

R=gab@chromium.org

Change-Id: I1fdaa6b6d3e445fff00c850a1e41a35f95959e1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2260939
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781694}
parent bce23012
...@@ -278,9 +278,11 @@ void Thread::DetachFromSequence() { ...@@ -278,9 +278,11 @@ void Thread::DetachFromSequence() {
} }
PlatformThreadId Thread::GetThreadId() const { PlatformThreadId Thread::GetThreadId() const {
// If the thread is created but not started yet, wait for |id_| being ready. if (!id_event_.IsSignaled()) {
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait; // If the thread is created but not started yet, wait for |id_| being ready.
id_event_.Wait(); base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
id_event_.Wait();
}
return id_; return id_;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment