summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/threads.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vlib/threads.h b/src/vlib/threads.h
index b47a633c2cc..17944536b6c 100644
--- a/src/vlib/threads.h
+++ b/src/vlib/threads.h
@@ -445,6 +445,14 @@ vlib_get_worker_vlib_main (u32 worker_index)
return vm;
}
+static inline u8
+vlib_thread_is_main_w_barrier (void)
+{
+ return (!vlib_num_workers ()
+ || ((vlib_get_thread_index () == 0
+ && vlib_worker_threads->wait_at_barrier[0])));
+}
+
static inline void
vlib_put_frame_queue_elt (vlib_frame_queue_elt_t * hf)
{