| Index: third_party/WebKit/Source/platform/WaitableEvent.cpp
|
| diff --git a/third_party/WebKit/Source/platform/WaitableEvent.cpp b/third_party/WebKit/Source/platform/WaitableEvent.cpp
|
| index 3bbb8577bdfdbab3157fcc113968a651576450eb..674a6ab07e121ad5585bb5622122a655861a8aaa 100644
|
| --- a/third_party/WebKit/Source/platform/WaitableEvent.cpp
|
| +++ b/third_party/WebKit/Source/platform/WaitableEvent.cpp
|
| @@ -5,6 +5,9 @@
|
| #include "platform/WaitableEvent.h"
|
|
|
| #include "base/synchronization/waitable_event.h"
|
| +#include "platform/heap/SafePoint.h"
|
| +#include "platform/heap/ThreadState.h"
|
| +#include "wtf/Optional.h"
|
| #include "wtf/PtrUtil.h"
|
| #include <vector>
|
|
|
| @@ -30,7 +33,15 @@ void WaitableEvent::reset()
|
|
|
| void WaitableEvent::wait()
|
| {
|
| - m_impl->Wait();
|
| + if (ThreadState::current()) {
|
| + // We only enter a safe point scope if the thread is attached, ex. never
|
| + // during shutdown.
|
| + // TODO(esprehn): Why can't SafePointScope do this for us?
|
| + SafePointScope scope(BlinkGC::HeapPointersOnStack);
|
| + m_impl->Wait();
|
| + } else {
|
| + m_impl->Wait();
|
| + }
|
| }
|
|
|
| void WaitableEvent::signal()
|
|
|