14 #ifndef LLVM_SUPPORT_RWMUTEX_H
15 #define LLVM_SUPPORT_RWMUTEX_H
72 #if defined(LLVM_ENABLE_THREADS) && LLVM_ENABLE_THREADS != 0
88 template<
bool mt_only>
113 assert(readers > 0 &&
"Reader lock not acquired before release!");
124 assert(writers == 0 &&
"Writer lock already acquired!");
135 assert(writers == 1 &&
"Writer lock not acquired before release!");
148 template<
bool mt_only>
157 mutex.unlock_shared();
164 template<
bool mt_only>
182 #endif // LLVM_SUPPORT_RWMUTEX_H
SmartRWMutex< mt_only > & mutex
~RWMutexImpl()
Releases and removes the lock.
SmartRWMutex< false > RWMutex
SmartMutex - An R/W mutex with a compile time constant parameter that indicates whether this mutex sh...
bool writer_release()
Attempts to release the lock in writer mode.
bool writer_acquire()
Attempts to unconditionally acquire the lock in reader mode.
ScopedReader - RAII acquisition of a reader lock.
ScopedWriter - RAII acquisition of a writer lock.
bool reader_acquire()
Attempts to unconditionally acquire the lock in reader mode.
RWMutexImpl()
Initializes the lock but doesn't acquire it.
Platform agnostic RWMutex class.
bool llvm_is_multithreaded()
Returns true if LLVM is compiled with support for multi-threading, and false otherwise.
SmartRWMutex< mt_only > & mutex
SmartScopedReader< false > ScopedReader
SmartScopedReader(SmartRWMutex< mt_only > &m)
SmartScopedWriter< false > ScopedWriter
SmartScopedWriter(SmartRWMutex< mt_only > &m)
bool reader_release()
Attempts to release the lock in reader mode.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())