Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions iocore/eventsystem/I_Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class Thread
This gets a cached copy of the time so it is very fast and reasonably accurate.
The cached time is updated every time the actual operating system time is fetched which is
at least every 10ms and generally more frequently.
@note The cached copy shared among threads which means the cached copy is updated
for all threads if any thread updates it.

@note The cached copy is thread local which means each thread need to update the cached copy by itself.
*/
static ink_hrtime get_hrtime();

Expand All @@ -177,7 +177,7 @@ class Thread
protected:
Thread();

static ink_hrtime cur_time;
static thread_local ink_hrtime cur_time;
};

extern Thread *this_thread();
Expand Down
2 changes: 1 addition & 1 deletion iocore/eventsystem/Thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// Common Interface impl //
///////////////////////////////////////////////

ink_hrtime Thread::cur_time = ink_get_hrtime_internal();
thread_local ink_hrtime Thread::cur_time = ink_get_hrtime_internal();
thread_local Thread *Thread::this_thread_ptr;

Thread::Thread()
Expand Down
2 changes: 1 addition & 1 deletion proxy/logging/Log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ Log::flush_thread_main(void * /* args ATS_UNUSED */)

// Time to work on periodic events??
//
now = Thread::get_hrtime() / HRTIME_SECOND;
now = Thread::get_hrtime_updated() / HRTIME_SECOND;
if (now >= last_time + periodic_tasks_interval) {
Debug("log-preproc", "periodic tasks for %" PRId64, (int64_t)now);
periodic_tasks(now);
Expand Down