summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/main.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 598c3ba836f..d6b2d1f875f 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -290,6 +290,13 @@ void vlib_worker_loop (vlib_main_t * vm);
always_inline f64
vlib_time_now (vlib_main_t * vm)
{
+#if CLIB_DEBUG > 0
+ extern __thread uword __os_thread_index;
+#endif
+ /*
+ * Make sure folks don't pass &vlib_global_main from a worker thread.
+ */
+ ASSERT (vm->thread_index == __os_thread_index);
return clib_time_now (&vm->clib_time) + vm->time_offset;
}