diff options
Diffstat (limited to 'chromium/base/threading/thread.cc')
-rw-r--r-- | chromium/base/threading/thread.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chromium/base/threading/thread.cc b/chromium/base/threading/thread.cc index d264c1d2602..8659724616a 100644 --- a/chromium/base/threading/thread.cc +++ b/chromium/base/threading/thread.cc @@ -278,9 +278,11 @@ void Thread::DetachFromSequence() { } PlatformThreadId Thread::GetThreadId() const { - // If the thread is created but not started yet, wait for |id_| being ready. - base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait; - id_event_.Wait(); + if (!id_event_.IsSignaled()) { + // If the thread is created but not started yet, wait for |id_| being ready. + base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait; + id_event_.Wait(); + } return id_; } |