aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTaskGroup.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-06-17 07:53:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-17 07:53:22 -0700
commit942e99b9c411d093851db8d12c8357f409563007 (patch)
tree8d207ed941ce017ed12cf185ce3b679d0526cafd /src/core/SkTaskGroup.h
parent2334fb655f8d4ef5915770d32bf845c88d3627f4 (diff)
Modernize atomics in SkTaskGroup's threadpool.
- Use SkAtomic<int32_t> for pending work count so we're statically forced to operate on it with atomic methods. - Replacing old methods like sk_atomic_inc/dec gives us finer control over which barriers we need for each operation. No public API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1193493003
Diffstat (limited to 'src/core/SkTaskGroup.h')
-rw-r--r--src/core/SkTaskGroup.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkTaskGroup.h b/src/core/SkTaskGroup.h
index 14a52c6aac..8c7369da25 100644
--- a/src/core/SkTaskGroup.h
+++ b/src/core/SkTaskGroup.h
@@ -9,6 +9,7 @@
#define SkTaskGroup_DEFINED
#include "SkTypes.h"
+#include "SkAtomics.h"
struct SkRunnable;
@@ -45,7 +46,7 @@ private:
void add (void_fn, void* arg);
void batch(void_fn, void* args, int N, size_t stride);
- /*atomic*/ int32_t fPending;
+ SkAtomic<int32_t> fPending;
};
#endif//SkTaskGroup_DEFINED