chromium/third_party/skia/include/private/base/SingleOwner.h

/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef skgpu_SingleOwner_DEFINED
#define skgpu_SingleOwner_DEFINED

#include "include/private/base/SkDebug.h" // IWYU pragma: keep

#if defined(SK_DEBUG)
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkThreadAnnotations.h"
#include "include/private/base/SkThreadID.h"

#endif

namespace skgpu {

#if defined(SK_DEBUG)

#define SKGPU_ASSERT_SINGLE_OWNER(obj)

// This is a debug tool to verify an object is only being used from one thread at a time.
class SingleOwner {};
#else
#define SKGPU_ASSERT_SINGLE_OWNER
class SingleOwner {}; // Provide a no-op implementation so we can pass pointers to constructors
#endif

} // namespace skgpu

#endif