[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libc / src / __support / threads / gpu / mutex.h
blob7a23604b5b986a0e75c8aa1098f15c657d1983d0
1 //===--- Implementation of a GPU mutex class --------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_SRC___SUPPORT_THREAD_GPU_MUTEX_H
10 #define LLVM_LIBC_SRC___SUPPORT_THREAD_GPU_MUTEX_H
12 #include "src/__support/macros/attributes.h"
13 #include "src/__support/threads/mutex_common.h"
15 namespace LIBC_NAMESPACE {
17 /// Implementation of a simple passthrough mutex which guards nothing. A
18 /// complete Mutex locks in general cannot be implemented on the GPU. We simply
19 /// define the Mutex interface and require that only a single thread executes
20 /// code requiring a mutex lock.
21 struct Mutex {
22 LIBC_INLINE constexpr Mutex(bool, bool, bool) {}
24 LIBC_INLINE MutexError lock() { return MutexError::NONE; }
25 LIBC_INLINE MutexError unlock() { return MutexError::NONE; }
26 LIBC_INLINE MutexError reset() { return MutexError::NONE; }
29 } // namespace LIBC_NAMESPACE
31 #endif