Index: gpu/command_buffer/service/sync_point_manager.h |
diff --git a/gpu/command_buffer/service/sync_point_manager.h b/gpu/command_buffer/service/sync_point_manager.h |
index a72566b0dc844dca20d360b2ef907b5530868088..df752fdcd335a0cd2b45b29b6e0f34d3ce9ec6e0 100644 |
--- a/gpu/command_buffer/service/sync_point_manager.h |
+++ b/gpu/command_buffer/service/sync_point_manager.h |
@@ -13,6 +13,7 @@ |
#include "base/callback.h" |
#include "base/containers/hash_tables.h" |
#include "base/logging.h" |
+#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/synchronization/condition_variable.h" |
@@ -137,6 +138,7 @@ class GPU_EXPORT SyncPointClientState |
private: |
friend class base::RefCountedThreadSafe<SyncPointClientState>; |
friend class SyncPointClient; |
+ friend class SyncPointClientWaiter; |
friend class SyncPointOrderData; |
struct ReleaseCallback { |
@@ -232,6 +234,30 @@ class GPU_EXPORT SyncPointClient { |
DISALLOW_COPY_AND_ASSIGN(SyncPointClient); |
}; |
+// A SyncPointClientWaiter is a Sync Point Client which can only wait and on |
+// fence syncs and not release any fence syncs itself. Because they cannot |
+// release any fence syncs they do not need an associated order number since |
+// deadlocks cannot happen. Note that it is important that this class does |
+// not exist in the same execution thread as a SyncPointClient, or else a |
+// deadlock could occur. |
piman
2015/11/05 00:04:36
That isn't consistent with the usage in GpuChannel
David Yen
2015/11/05 00:34:27
For some reason I thought control messages were ha
|
+class GPU_EXPORT SyncPointClientWaiter { |
+ public: |
+ SyncPointClientWaiter() {} |
+ ~SyncPointClientWaiter() {} |
+ |
+ bool Wait(SyncPointClientState* release_state, |
+ uint64_t release_count, |
+ const base::Closure& wait_complete_callback); |
+ |
+ bool WaitNonThreadSafe(SyncPointClientState* release_state, |
+ uint64_t release_count, |
+ scoped_refptr<base::SingleThreadTaskRunner> runner, |
+ const base::Closure& wait_complete_callback); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(SyncPointClientWaiter); |
+}; |
+ |
// This class manages the sync points, which allow cross-channel |
// synchronization. |
class GPU_EXPORT SyncPointManager { |