BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
spin_yield_lock.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 namespace fc {
4  class microseconds;
5  class time_point;
6 
21  public:
23  bool try_lock();
24  bool try_lock_for( const microseconds& rel_time );
25  bool try_lock_until( const time_point& abs_time );
26  void lock();
27  void unlock();
28 
29  private:
30  enum lock_store {locked,unlocked};
31  int _lock;
32  };
33 
34 } // namespace fc
35 
fc
Definition: api.hpp:15
fc::spin_yield_lock::lock
void lock()
Definition: spin_yield_lock.cpp:38
fc::spin_yield_lock::try_lock_until
bool try_lock_until(const time_point &abs_time)
Definition: spin_yield_lock.cpp:29
fc::spin_yield_lock::spin_yield_lock
spin_yield_lock()
Definition: spin_yield_lock.cpp:12
fc::spin_yield_lock
modified spin-lock that yields on failure, but becomes a 'spin lock' if there are no other tasks to y...
Definition: spin_yield_lock.hpp:20
fc::spin_yield_lock::unlock
void unlock()
Definition: spin_yield_lock.cpp:45
fc::spin_yield_lock::try_lock
bool try_lock()
Definition: spin_yield_lock.cpp:20
fc::microseconds
Definition: time.hpp:12
fc::time_point
Definition: time.hpp:44
fc::spin_yield_lock::try_lock_for
bool try_lock_for(const microseconds &rel_time)
Definition: spin_yield_lock.cpp:25