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

Unified Diff: gpu/command_buffer/client/query_tracker.h

Issue 184223003: gpu: Use explicit atomics instead of assuming that 32bit read/writes are atomic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more s/uint32/base::subtle::Atomic32/ Created 6 years, 9 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: gpu/command_buffer/client/query_tracker.h
diff --git a/gpu/command_buffer/client/query_tracker.h b/gpu/command_buffer/client/query_tracker.h
index 9e7f501768b74a5bbfa4dccfb2bee6e153622dfa..219f18665a3de11fda770c6bbea90f95572e6b10 100644
--- a/gpu/command_buffer/client/query_tracker.h
+++ b/gpu/command_buffer/client/query_tracker.h
@@ -10,6 +10,7 @@
#include <deque>
#include <list>
+#include "base/atomicops.h"
#include "base/containers/hash_tables.h"
#include "gles2_impl_export.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -105,6 +106,8 @@ class GLES2_IMPL_EXPORT QueryTracker {
void MarkAsActive() {
state_ = kActive;
++submit_count_;
+ if (submit_count_ == INT_MAX)
+ submit_count_ = 1;
}
void MarkAsPending(int32 token) {
@@ -113,9 +116,7 @@ class GLES2_IMPL_EXPORT QueryTracker {
flushed_ = false;
}
- uint32 submit_count() const {
- return submit_count_;
- }
+ base::subtle::Atomic32 submit_count() const { return submit_count_; }
int32 token() const {
return token_;
@@ -144,7 +145,7 @@ class GLES2_IMPL_EXPORT QueryTracker {
GLenum target_;
QuerySyncManager::QueryInfo info_;
State state_;
- uint32 submit_count_;
+ base::subtle::Atomic32 submit_count_;
int32 token_;
bool flushed_;
uint64 client_begin_time_us_; // Only used for latency query target.
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/client/query_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698