diff options
author | Florin Coras <fcoras@cisco.com> | 2019-03-29 08:29:25 -0700 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-03-29 17:43:36 +0000 |
commit | 63d3ac6789740d58884aa4f7c91a96f592ae79d7 (patch) | |
tree | 02efd182b8ffa7f332fa6b6e0926472d47527b64 /src/vcl/vcl_locked.c | |
parent | 3593a9174a8e9faddb8d4eb451d1b4632c1e0df1 (diff) |
vls: add pthread check on vls_attr
Change-Id: I455d108dfe52d45d040167fecb37b33e9d630c3c
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vcl_locked.c')
-rw-r--r-- | src/vcl/vcl_locked.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vcl/vcl_locked.c b/src/vcl/vcl_locked.c index fb19b5df03f..55391912b89 100644 --- a/src/vcl/vcl_locked.c +++ b/src/vcl/vcl_locked.c @@ -468,7 +468,7 @@ vls_mt_rel_locks (int locks_acq) #define vls_mt_guard(_vls, _op) \ int _locks_acq = 0; \ - if (PREDICT_FALSE (vcl_get_worker_index () == ~0)); \ + if (PREDICT_FALSE (vcl_get_worker_index () == ~0)) \ vls_mt_add (); \ if (PREDICT_FALSE (vlsl->vls_mt_n_threads > 1)) \ vls_mt_acq_locks (_vls, _op, &_locks_acq); \ @@ -562,6 +562,9 @@ vls_attr (vls_handle_t vlsh, uint32_t op, void *buffer, uint32_t * buflen) vcl_locked_session_t *vls; int rv; + if (PREDICT_FALSE (vcl_get_worker_index () == ~0)) + vls_mt_add (); + if (!(vls = vls_get_w_dlock (vlsh))) return VPPCOM_EBADFD; rv = vppcom_session_attr (vls_to_sh_tu (vls), op, buffer, buflen); @@ -735,6 +738,9 @@ vls_epoll_create (void) vcl_session_handle_t sh; vls_handle_t vlsh; + if (PREDICT_FALSE (vcl_get_worker_index () == ~0)) + vls_mt_add (); + sh = vppcom_epoll_create (); if (sh == INVALID_SESSION_ID) return VLS_INVALID_HANDLE; |