chromium/net/third_party/quiche/src/quiche/common/platform/api/quiche_mutex.h

// Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_MUTEX_H_
#define QUICHE_COMMON_PLATFORM_API_QUICHE_MUTEX_H_

#include "quiche_platform_impl/quiche_mutex_impl.h"

#define QUICHE_EXCLUSIVE_LOCKS_REQUIRED
#define QUICHE_GUARDED_BY
#define QUICHE_LOCKABLE
#define QUICHE_LOCKS_EXCLUDED
#define QUICHE_SHARED_LOCKS_REQUIRED
#define QUICHE_EXCLUSIVE_LOCK_FUNCTION
#define QUICHE_UNLOCK_FUNCTION
#define QUICHE_SHARED_LOCK_FUNCTION
#define QUICHE_SCOPED_LOCKABLE
#define QUICHE_ASSERT_SHARED_LOCK

namespace quiche {

// A class representing a non-reentrant mutex in QUIC.
class QUICHE_LOCKABLE QUICHE_EXPORT QuicheMutex {};

// A helper class that acquires the given QuicheMutex shared lock while the
// QuicheReaderMutexLock is in scope.
class QUICHE_SCOPED_LOCKABLE QUICHE_EXPORT QuicheReaderMutexLock {};

// A helper class that acquires the given QuicheMutex exclusive lock while the
// QuicheWriterMutexLock is in scope.
class QUICHE_SCOPED_LOCKABLE QUICHE_EXPORT QuicheWriterMutexLock {};

// A Notification allows threads to receive notification of a single occurrence
// of a single event.
class QUICHE_EXPORT QuicheNotification {};

}  // namespace quiche

#endif  // QUICHE_COMMON_PLATFORM_API_QUICHE_MUTEX_H_