event: Eliminate g_app_start_event
Change-Id: Ied9c6ebe5e15ee66d6d9695e55b04b33200dd33b Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446990 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
e2104c3339
commit
744857a79a
@ -67,9 +67,10 @@ struct spdk_app {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct spdk_app g_spdk_app;
|
static struct spdk_app g_spdk_app;
|
||||||
static struct spdk_event *g_app_start_event = NULL;
|
static spdk_event_fn g_start_fn = NULL;
|
||||||
|
static void *g_start_arg = NULL;
|
||||||
static struct spdk_event *g_shutdown_event = NULL;
|
static struct spdk_event *g_shutdown_event = NULL;
|
||||||
static int g_init_lcore;
|
static uint32_t g_init_lcore;
|
||||||
static bool g_delay_subsystem_init = false;
|
static bool g_delay_subsystem_init = false;
|
||||||
static bool g_shutdown_sig_received = false;
|
static bool g_shutdown_sig_received = false;
|
||||||
static char *g_executable_name;
|
static char *g_executable_name;
|
||||||
@ -348,7 +349,10 @@ static void
|
|||||||
spdk_app_start_application(void)
|
spdk_app_start_application(void)
|
||||||
{
|
{
|
||||||
spdk_rpc_set_state(SPDK_RPC_RUNTIME);
|
spdk_rpc_set_state(SPDK_RPC_RUNTIME);
|
||||||
spdk_event_call(g_app_start_event);
|
|
||||||
|
assert(spdk_env_get_current_core() == g_init_lcore);
|
||||||
|
|
||||||
|
g_start_fn(g_start_arg, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -677,11 +681,13 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_event_fn start_fn,
|
|||||||
g_spdk_app.shm_id = opts->shm_id;
|
g_spdk_app.shm_id = opts->shm_id;
|
||||||
g_spdk_app.shutdown_cb = opts->shutdown_cb;
|
g_spdk_app.shutdown_cb = opts->shutdown_cb;
|
||||||
g_spdk_app.rc = 0;
|
g_spdk_app.rc = 0;
|
||||||
|
|
||||||
g_init_lcore = spdk_env_get_current_core();
|
g_init_lcore = spdk_env_get_current_core();
|
||||||
g_delay_subsystem_init = opts->delay_subsystem_init;
|
g_delay_subsystem_init = opts->delay_subsystem_init;
|
||||||
|
g_start_fn = start_fn;
|
||||||
|
g_start_arg = arg1;
|
||||||
|
|
||||||
event = spdk_event_allocate(g_init_lcore, bootstrap_fn, NULL, NULL);
|
event = spdk_event_allocate(g_init_lcore, bootstrap_fn, NULL, NULL);
|
||||||
g_app_start_event = spdk_event_allocate(g_init_lcore, start_fn, arg1, NULL);
|
|
||||||
|
|
||||||
spdk_event_call(event);
|
spdk_event_call(event);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user