1 //===----------------------------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
8 
9 #ifndef _LIBCPP___MUTEX_TAG_TYPES_H
10 #define _LIBCPP___MUTEX_TAG_TYPES_H
11 
12 #include <__config>
13 
14 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15 #  pragma GCC system_header
16 #endif
17 
18 #ifndef _LIBCPP_HAS_NO_THREADS
19 
20 _LIBCPP_BEGIN_NAMESPACE_STD
21 
22 struct _LIBCPP_EXPORTED_FROM_ABI defer_lock_t {
23   explicit defer_lock_t() = default;
24 };
25 
26 struct _LIBCPP_EXPORTED_FROM_ABI try_to_lock_t {
27   explicit try_to_lock_t() = default;
28 };
29 
30 struct _LIBCPP_EXPORTED_FROM_ABI adopt_lock_t {
31   explicit adopt_lock_t() = default;
32 };
33 
34 #  if _LIBCPP_STD_VER >= 17
35 inline constexpr defer_lock_t defer_lock   = defer_lock_t();
36 inline constexpr try_to_lock_t try_to_lock = try_to_lock_t();
37 inline constexpr adopt_lock_t adopt_lock   = adopt_lock_t();
38 #  elif !defined(_LIBCPP_CXX03_LANG)
39 constexpr defer_lock_t defer_lock   = defer_lock_t();
40 constexpr try_to_lock_t try_to_lock = try_to_lock_t();
41 constexpr adopt_lock_t adopt_lock   = adopt_lock_t();
42 #  endif
43 
44 _LIBCPP_END_NAMESPACE_STD
45 
46 #endif // _LIBCPP_HAS_NO_THREADS
47 
48 #endif // _LIBCPP___MUTEX_TAG_TYPES_H
49