diff --git a/iocore/eventsystem/I_Thread.h b/iocore/eventsystem/I_Thread.h index 844cfaeb01f..76d5cabd867 100644 --- a/iocore/eventsystem/I_Thread.h +++ b/iocore/eventsystem/I_Thread.h @@ -68,6 +68,8 @@ #include "tscore/ink_thread.h" #include "I_ProxyAllocator.h" +#include + class ProxyMutex; constexpr int MAX_THREAD_NAME_LENGTH = 16; @@ -177,7 +179,7 @@ class Thread protected: Thread(); - static ink_hrtime cur_time; + static std::atomic cur_time; }; extern Thread *this_thread(); diff --git a/iocore/eventsystem/Thread.cc b/iocore/eventsystem/Thread.cc index 38c6c340908..11db72acda3 100644 --- a/iocore/eventsystem/Thread.cc +++ b/iocore/eventsystem/Thread.cc @@ -34,7 +34,7 @@ // Common Interface impl // /////////////////////////////////////////////// -ink_hrtime Thread::cur_time = ink_get_hrtime_internal(); +std::atomic Thread::cur_time = ink_get_hrtime_internal(); thread_local Thread *Thread::this_thread_ptr; Thread::Thread()