summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/elog.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-06-30 08:46:24 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-06-30 16:24:18 +0000
commit12c6fdc551d2a092dc530639365d9e4ad8493d97 (patch)
tree15701c2a0affc805bbed1c6c88d7b4327c6fe445 /src/vppinfra/elog.c
parentbb620d74b247f419eb485886c55148099b0213bb (diff)
VPP-893: handle multiple simultaneous event registrations
Change-Id: I8cd90820624987dbef848935e2de86fa66a86c17 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/elog.c')
-rw-r--r--src/vppinfra/elog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vppinfra/elog.c b/src/vppinfra/elog.c
index 12e3f5d4bd8..182ca127b12 100644
--- a/src/vppinfra/elog.c
+++ b/src/vppinfra/elog.c
@@ -108,6 +108,13 @@ elog_event_type_register (elog_main_t * em, elog_event_type_t * t)
elog_lock (em);
+ /* Multiple simultaneous registration attempts, */
+ if (t->type_index_plus_one > 0)
+ {
+ elog_unlock (em);
+ return t->type_index_plus_one - 1;
+ }
+
l = vec_len (em->event_types);
t->type_index_plus_one = 1 + l;