| 
    rippled
    
   | 
 
A spinlock implemented on top of an atomic integer. More...
#include <spinlock.h>
Public Member Functions | |
| spinlock (spinlock const &)=delete | |
| spinlock & | operator= (spinlock const &)=delete | 
| spinlock (std::atomic< T > &lock) | |
| Grabs the.   | |
| bool | try_lock () | 
| void | lock () | 
| void | unlock () | 
Private Attributes | |
| std::atomic< T > & | lock_ | 
A spinlock implemented on top of an atomic integer.
packed_spinlock and spinlock against the same underlying atomic integer can result in spinlock not being able to actually acquire the lock during periods of high contention, because of how the two locks operate: spinlock will spin trying to grab all the bits at once, whereas any given packed_spinlock will only try to grab one bit at a time. Caveat emptor.This class meets the requirements of Lockable: https://en.cppreference.com/w/cpp/named_req/Lockable
Definition at line 166 of file spinlock.h.
      
  | 
  delete | 
| ripple::spinlock< T >::spinlock | ( | std::atomic< T > & | lock | ) | 
Grabs the.
| lock | The atomic integer to spin against. | 
lock be on a cacheline by itself. Definition at line 186 of file spinlock.h.
      
  | 
  delete | 
| bool ripple::spinlock< T >::try_lock | ( | ) | 
Definition at line 191 of file spinlock.h.
| void ripple::spinlock< T >::lock | ( | ) | 
Definition at line 203 of file spinlock.h.
| void ripple::spinlock< T >::unlock | ( | ) | 
Definition at line 217 of file spinlock.h.
      
  | 
  private | 
Definition at line 172 of file spinlock.h.