27 #ifndef EMBB_BASE_MUTEX_H_ 28 #define EMBB_BASE_MUTEX_H_ 30 #include <embb/base/internal/platform.h> 31 #include <embb/base/exceptions.h> 32 #include <embb/base/c/mutex.h> 100 class ConditionVariable;
121 virtual ~MutexBase() = 0;
159 internal::MutexType mutex_;
214 unsigned int number_spins = 1
256 class Mutex :
public internal::MutexBase {
391 template<
typename Mutex = embb::base::Mutex>
490 template<
typename Mutex = embb::base::Mutex>
593 bool OwnsLock()
const;
620 #include <embb/base/internal/mutex-inl.h> 622 #endif // EMBB_BASE_MUTEX_H_ Definition: lock_free_mpmc_queue.h:40
Scoped lock (according to the RAII principle) using a mutex.
Definition: mutex.h:392
opaque_type embb_spinlock_t
Opaque type representing a spinlock.
Definition: mutex.h:60
const DeferLockTag defer_lock
Tag variable for deferred UniqueLock construction.
Definition: mutex.h:444
Tag type for try-lock UniqueLock construction.
Definition: mutex.h:451
Tag type for deferred UniqueLock construction.
Definition: mutex.h:437
~LockGuard()
Unlocks the mutex.
Definition: mutex.h:410
LockGuard(Mutex &mutex)
Creates the lock and locks the mutex.
Definition: mutex.h:400
const TryLockTag try_lock
Tag variable for try-lock UniqueLock construction.
Definition: mutex.h:458
Tag type for adopt UniqueLock constructor.
Definition: mutex.h:465
Represents a condition variable for thread synchronization.
Definition: condition_variable.h:56
const AdoptLockTag adopt_lock
Tag variable for adopt UniqueLock construction.
Definition: mutex.h:472
Spinlock.
Definition: mutex.h:175
Non-recursive, exclusive mutex.
Definition: mutex.h:256
Recursive, exclusive mutex.
Definition: mutex.h:327
Flexible ownership wrapper for a mutex.
Definition: mutex.h:491