aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-09-19 16:34:52 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-19 20:58:49 +0000
commitfe69f9a50ac1a6a61c9dda9c28c97599131656ee (patch)
tree07419b56df0c85789afe5145adcd0fdfa1ddecd5 /tools
parent6c4ea7e8801c5b2b758c67d01e236da29292799b (diff)
Make GrFakeRefObj::fNext atomic.
This lets you make them on different threads simultaneously. Change-Id: Ife4228ae4721b35c718ece1a30cc5686f3690c13 Reviewed-on: https://skia-review.googlesource.com/48800 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/gpu/gl/debug/GrFakeRefObj.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gpu/gl/debug/GrFakeRefObj.h b/tools/gpu/gl/debug/GrFakeRefObj.h
index e59aeb3594..accb5ce621 100644
--- a/tools/gpu/gl/debug/GrFakeRefObj.h
+++ b/tools/gpu/gl/debug/GrFakeRefObj.h
@@ -8,6 +8,7 @@
#ifndef GrFakeRefObj_DEFINED
#define GrFakeRefObj_DEFINED
+#include <atomic>
#include "SkTypes.h"
#include "gl/GrGLInterface.h"
@@ -26,7 +27,7 @@ public:
, fDeleted(false) {
// source for globally unique IDs - 0 is reserved!
- static int fNextID = 0;
+ static std::atomic<int> fNextID{0};
fID = ++fNextID;
}