skia2/include/core/SkThread.h
mtklein a669bc7a7a Atomics overhaul.
This merges and refactors SkAtomics.h and SkBarriers.h into SkAtomics.h and
some ports/ implementations. The major new feature is that we can express
memory orders explicitly rather than only through comments.

The porting layer is reduced to four template functions:
  - sk_atomic_load
  - sk_atomic_store
  - sk_atomic_fetch_add
  - sk_atomic_compare_exchange
From those four we can reconstruct all our previous sk_atomic_foo.

There are three ports:
  - SkAtomics_std:    uses C++11 <atomic>,             used with MSVC
  - SkAtomics_atomic: uses newer GCC/Clang intrinsics, used on not-MSVC where possible
  - SkAtomics_sync:   uses older GCC/Clang intrinsics, used where SkAtomics_atomic not supported

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/896553002
2015-02-02 12:22:07 -08:00

17 lines
343 B
C

/*
* Copyright 2006 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkThread_DEFINED
#define SkThread_DEFINED
// TODO: delete this file, or maybe move the definition of SkThread here.
#include "SkAtomics.h"
#include "SkMutex.h"
#endif