summaryrefslogtreecommitdiffstats
path: root/src/vlib/threads.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/threads.h')
-rw-r--r--src/vlib/threads.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vlib/threads.h b/src/vlib/threads.h
index 0ceb21e1218..5a295e03319 100644
--- a/src/vlib/threads.h
+++ b/src/vlib/threads.h
@@ -423,6 +423,21 @@ vlib_worker_thread_barrier_check (void)
}
while (*vlib_worker_threads->wait_at_barrier)
;
+
+ /*
+ * Recompute the offset from thread-0 time.
+ * Note that vlib_time_now adds vm->time_offset, so
+ * clear it first. Save the resulting idea of "now", to
+ * see how well we're doing. See show_clock_command_fn(...)
+ */
+ {
+ f64 now;
+ vm->time_offset = 0.0;
+ now = vlib_time_now (vm);
+ vm->time_offset = vlib_global_main.time_last_barrier_release - now;
+ vm->time_last_barrier_release = vlib_time_now (vm);
+ }
+
if (CLIB_DEBUG > 0)
vm->parked_at_barrier = 0;
clib_atomic_fetch_add (vlib_worker_threads->workers_at_barrier, -1);