lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Member Functions
lean::concurrent::shareable_spin_lock< Counter > Class Template Reference

Implements a shareable spin lock that is NOT reentrant. More...

#include <shareable_spin_lock.h>

Inherits noncopyable.

List of all members.

Public Member Functions

 shareable_spin_lock ()
 Constructs a shareable spin lock.
LEAN_INLINE bool try_lock ()
 Tries to exclusively lock this spin lock, returning false if currently locked / shared by another user.
LEAN_INLINE bool try_upgrade_lock ()
 Tries to atomically upgrade shared ownership of this spin lock to exclusive ownership, returning false if currently shared with another user.
LEAN_INLINE void lock ()
 Exclusively locks this spin lock, returning immediately on success, otherwise waiting for the lock to become available.
LEAN_INLINE void upgrade_lock ()
 Atomically upgrades shared ownership of this spin lock to exclusive ownership, returning immediately on success, otherwise waiting for the lock to become available.
LEAN_INLINE void downgrade_lock ()
 Atomically releases exclusive ownership and re-acquires shared ownership, permitting waiting threads to continue execution.
LEAN_INLINE void unlock ()
 Unlocks this spin lock, permitting waiting threads to continue execution.
LEAN_INLINE bool try_lock_shared ()
 Tries to obtain shared ownership of this spin lock, returning false if currently locked exclusively by another user.
LEAN_INLINE void lock_shared ()
 Obtains shared ownership of this spin lock, returning immediately on success, otherwise waiting for the lock to become available.
LEAN_INLINE void unlock_shared ()
 Releases shared ownership of this spin lock, permitting waiting threads to continue execution.

Detailed Description

template<class Counter = long>
class lean::concurrent::shareable_spin_lock< Counter >

Implements a shareable spin lock that is NOT reentrant.


The documentation for this class was generated from the following file: