Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
rcu_read_lock();
app = agent_find_app_by_sock(sock);
assert(app);
- rcu_read_unlock();
- /* RCU read side lock is taken in this function call. */
+ /* RCU read side lock is assumed to be held by this function. */
agent_delete_app(app);
/* The application is freed in a RCU call but the socket is closed here. */
agent_destroy_app(app);
+ rcu_read_unlock();
}
/*
/*
* Delete agent application from the global hash table.
+ *
+ * rcu_read_lock() must be held by the caller.
*/
void agent_delete_app(struct agent_app *app)
{
DBG3("Agent deleting app pid: %d and sock: %d", app->pid, app->sock->fd);
iter.iter.node = &app->node.node;
- rcu_read_lock();
ret = lttng_ht_del(agent_apps_ht_by_sock, &iter);
- rcu_read_unlock();
assert(!ret);
}