Warning, file /include/oneapi/tbb/null_mutex.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef __TBB_null_mutex_H
0018 #define __TBB_null_mutex_H
0019
0020 #include "detail/_config.h"
0021 #include "detail/_namespace_injection.h"
0022 #include "detail/_mutex_common.h"
0023
0024 namespace tbb {
0025 namespace detail {
0026 namespace d1 {
0027
0028
0029
0030
0031 class null_mutex {
0032 public:
0033
0034 constexpr null_mutex() noexcept = default;
0035
0036
0037 ~null_mutex() = default;
0038
0039
0040 null_mutex(const null_mutex&) = delete;
0041 null_mutex& operator=(const null_mutex&) = delete;
0042
0043
0044 class scoped_lock {
0045 public:
0046
0047 constexpr scoped_lock() noexcept = default;
0048 scoped_lock(null_mutex&) {}
0049
0050
0051 ~scoped_lock() = default;
0052
0053
0054 scoped_lock(const scoped_lock&) = delete;
0055 scoped_lock& operator=(const scoped_lock&) = delete;
0056
0057 void acquire(null_mutex&) {}
0058 bool try_acquire(null_mutex&) { return true; }
0059 void release() {}
0060 };
0061
0062
0063 static constexpr bool is_rw_mutex = false;
0064 static constexpr bool is_recursive_mutex = true;
0065 static constexpr bool is_fair_mutex = true;
0066
0067 void lock() {}
0068 bool try_lock() { return true; }
0069 void unlock() {}
0070 };
0071
0072 }
0073 }
0074
0075 inline namespace v1 {
0076 using detail::d1::null_mutex;
0077 }
0078 }
0079
0080 #endif