s = vcl_session_get (wrk, vls->session_index);
if (s->session_state != STATE_LISTEN)
return;
- vppcom_send_unbind_sock (wrk, s->vpp_handle);
+ vcl_send_session_unlisten (wrk, s);
s->session_state = STATE_LISTEN_NO_MQ;
vls_listener_wrk_set (vls, wrk_index, 0 /* is_active */ );
}
wrk->sessions = pool_dup (parent_wrk->sessions);
wrk->session_index_by_vpp_handles =
hash_dup (parent_wrk->session_index_by_vpp_handles);
- vls_table_wlock ();
+ vls_table_rlock ();
/* *INDENT-OFF* */
pool_foreach (s, wrk->sessions, ({
}));
/* *INDENT-ON* */
- vls_table_wunlock ();
+ vls_table_runlock ();
}
static void
#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); \
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);
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;