summaryrefslogtreecommitdiffstats
path: root/src/vlib/threads.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-09-18 16:12:50 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-09-19 06:05:29 +0000
commit568ebc76b594f8f29bb131b252031d72c055e0b0 (patch)
treef14aca2a369be4bb3bf34b7019a10a31d3702bcf /src/vlib/threads.h
parent5c7c49d15212c34db9c4244cd55913a7b4f363ce (diff)
session: improve close procedure
Change-Id: I6201a044e70ab6a58db8212960c57edc77c41f96 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vlib/threads.h')
-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)
{