mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
ipc: Change init order to avoid assertion
This commit is contained in:
parent
cd163e366b
commit
aa6b8cd88d
|
@ -148,8 +148,9 @@ teardown_all(struct ipc_server *s)
|
||||||
|
|
||||||
ipc_server_mainloop_deinit(&s->ml);
|
ipc_server_mainloop_deinit(&s->ml);
|
||||||
|
|
||||||
os_mutex_destroy(&s->global_state.lock);
|
|
||||||
u_process_destroy(s->process);
|
u_process_destroy(s->process);
|
||||||
|
|
||||||
|
os_mutex_destroy(&s->global_state.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -450,6 +451,13 @@ init_all(struct ipc_server *s)
|
||||||
xrt_result_t xret;
|
xrt_result_t xret;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
ret = os_mutex_init(&s->global_state.lock);
|
||||||
|
if (ret < 0) {
|
||||||
|
IPC_ERROR(s, "Global state lock mutex failed to init!");
|
||||||
|
teardown_all(s);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
s->process = u_process_create_if_not_running();
|
s->process = u_process_create_if_not_running();
|
||||||
|
|
||||||
if (!s->process) {
|
if (!s->process) {
|
||||||
|
@ -505,13 +513,6 @@ init_all(struct ipc_server *s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = os_mutex_init(&s->global_state.lock);
|
|
||||||
if (ret < 0) {
|
|
||||||
IPC_ERROR(s, "Global state lock mutex failed to inti!");
|
|
||||||
teardown_all(s);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
u_var_add_root(s, "IPC Server", false);
|
u_var_add_root(s, "IPC Server", false);
|
||||||
u_var_add_log_level(s, &s->log_level, "Log level");
|
u_var_add_log_level(s, &s->log_level, "Log level");
|
||||||
u_var_add_bool(s, &s->exit_on_disconnect, "exit_on_disconnect");
|
u_var_add_bool(s, &s->exit_on_disconnect, "exit_on_disconnect");
|
||||||
|
|
Loading…
Reference in a new issue