8 if(clock_gettime(CLOCK_REALTIME, &tp) != 0) {
11 return (uint64_t)tp.tv_sec * 1000000 + tp.tv_nsec / 1000;
18 if(pthread_spin_init(&this->
m_oLck, PTHREAD_PROCESS_SHARED) != 0) {
24 if(pthread_spin_init(&this->
m_oLck, PTHREAD_PROCESS_SHARED) != 0) {
30 if(pthread_spin_destroy(&this->
m_oLck) != 0) {
36 if(pthread_spin_lock(&this->m_oLck) != 0) { \ 37 throw HLC_EXP_SPIN_LOCK(errno); \ 40 if(pthread_spin_unlock(&this->m_oLck) != 0) { \ 41 throw HLC_EXP_SPIN_UNLOCK(errno); \ 68 if((rtc > this->
m_rtc_us) && (rtc > msgHlc.m_rtc_us)) {
72 }
else if(*
this >= msgHlc) {
78 this->
m_logic = msgHlc.m_logic + 1;
93 return hlc > *
this && !(hlc == *
this);
103 return !(hlc > *
this);
108 return !(*
this > hlc);
virtual bool operator>(const HLC &hlc) const noexcept(true)
#define HLC_EXP_READ_RTC(x)
virtual bool operator<=(const HLC &hlc) const noexcept(true)
pthread_spinlock_t m_oLck
uint64_t read_rtc_us() noexcept(false)
virtual bool operator<(const HLC &hlc) const noexcept(true)
virtual void operator=(const HLC &hlc) noexcept(true)
virtual bool operator>=(const HLC &hlc) const noexcept(true)
HLC(uint64_t _r, uint64_t _l)
#define HLC_EXP_SPIN_INIT(x)
virtual void tick(bool thread_safe=true) noexcept(false)
virtual ~HLC() noexcept(false)
#define HLC_EXP_SPIN_DESTROY(x)
virtual bool operator==(const HLC &hlc) const noexcept(true)