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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1809753003: Use base::AtomicSequenceNumber for the flush id in GLES2Implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lastflush
Patch Set: lastflush-atomic: . Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 9bb62324ec89a1e116803cb62f01832f9b04cf1d..38a3acd868d51ee01a3085c67503ef70b993af65 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -17,6 +17,7 @@
#include <set>
#include <sstream>
#include <string>
+#include "base/atomic_sequence_num.h"
#include "base/compiler_specific.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
@@ -77,10 +78,8 @@ GLuint ToGLuint(const void* ptr) {
}
uint32_t GenerateNextFlushId() {
- static base::subtle::Atomic32 flush_id = 0;
- base::subtle::Atomic32 my_id =
- base::subtle::Barrier_AtomicIncrement(&flush_id, 1);
- return static_cast<uint32_t>(my_id);
+ static base::AtomicSequenceNumber flush_id;
piman 2016/03/16 23:49:29 I was thinking, move this out of the function and
danakj 2016/03/16 23:50:41 Oh, snap. Sure :)
+ return static_cast<uint32_t>(flush_id.GetNext());
}
} // anonymous namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698