Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Unified Diff: third_party/WebKit/Source/platform/WaitableEvent.cpp

Issue 2288973002: Merge TaskSynchronizer into WaitableEvent. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()
« no previous file with comments | « third_party/WebKit/Source/platform/TaskSynchronizer.cpp ('k') | third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698