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>
This commit is contained in:
Mike Klein 2017-09-19 16:34:52 -04:00 committed by Skia Commit-Bot
parent 6c4ea7e880
commit fe69f9a50a

View File

@ -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;
}