Warning, file /include/oneapi/tbb/null_rw_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_rw_mutex_H
0018 #define __TBB_null_rw_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_rw_mutex {
0032 public:
0033
0034 constexpr null_rw_mutex() noexcept = default;
0035
0036
0037 ~null_rw_mutex() = default;
0038
0039
0040 null_rw_mutex(const null_rw_mutex&) = delete;
0041 null_rw_mutex& operator=(const null_rw_mutex&) = delete;
0042
0043
0044 class scoped_lock {
0045 public:
0046
0047 constexpr scoped_lock() noexcept = default;
0048 scoped_lock(null_rw_mutex&, bool = true) {}
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_rw_mutex&, bool = true) {}
0058 bool try_acquire(null_rw_mutex&, bool = true) { return true; }
0059 void release() {}
0060 bool upgrade_to_writer() { return true; }
0061 bool downgrade_to_reader() { return true; }
0062
0063 bool is_writer() const { return true; }
0064 };
0065
0066
0067 static constexpr bool is_rw_mutex = true;
0068 static constexpr bool is_recursive_mutex = true;
0069 static constexpr bool is_fair_mutex = true;
0070
0071 void lock() {}
0072 bool try_lock() { return true; }
0073 void unlock() {}
0074 void lock_shared() {}
0075 bool try_lock_shared() { return true; }
0076 void unlock_shared() {}
0077 };
0078
0079 }
0080 }
0081
0082 inline namespace v1 {
0083 using detail::d1::null_rw_mutex;
0084 }
0085 }
0086
0087 #endif