chromium/base/allocator/partition_allocator/src/partition_alloc/partition_lock.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PARTITION_ALLOC_PARTITION_LOCK_H_
#define PARTITION_ALLOC_PARTITION_LOCK_H_

#include <atomic>
#include <type_traits>

#include "partition_alloc/build_config.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_base/immediate_crash.h"
#include "partition_alloc/partition_alloc_base/thread_annotations.h"
#include "partition_alloc/partition_alloc_base/threading/platform_thread.h"
#include "partition_alloc/partition_alloc_check.h"
#include "partition_alloc/spinning_mutex.h"
#include "partition_alloc/thread_isolation/thread_isolation.h"

namespace partition_alloc::internal {

class PA_LOCKABLE Lock {};

class PA_SCOPED_LOCKABLE ScopedGuard {};

class PA_SCOPED_LOCKABLE ScopedUnlockGuard {};

constexpr Lock::Lock() = default;

// We want PartitionRoot to not have a global destructor, so this should not
// have one.
static_assert;

}  // namespace partition_alloc::internal

namespace base {
namespace internal {

PartitionLock;
PartitionAutoLock;

}  // namespace internal
}  // namespace base

#endif  // PARTITION_ALLOC_PARTITION_LOCK_H_