The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipc: Re-order init functions [NFC]

+19 -20
+19 -20
src/xrt/ipc/server/ipc_server_process.c
··· 372 372 return 0; 373 373 } 374 374 375 + static void 376 + init_server_state(struct ipc_server *s) 377 + { 378 + // set up initial state for global vars, and each client state 379 + 380 + s->global_state.active_client_index = -1; // we start off with no active client. 381 + s->global_state.last_active_client_index = -1; 382 + s->current_slot_index = 0; 383 + 384 + for (uint32_t i = 0; i < IPC_MAX_CLIENTS; i++) { 385 + volatile struct ipc_client_state *ics = &s->threads[i].ics; 386 + ics->server = s; 387 + ics->server_thread_index = -1; 388 + } 389 + } 390 + 375 391 void 376 392 ipc_server_handle_failure(struct ipc_server *vs) 377 393 { ··· 524 540 return ret; 525 541 } 526 542 543 + // Never fails, do this second last. 544 + init_server_state(s); 545 + 527 546 u_var_add_root(s, "IPC Server", false); 528 547 u_var_add_log_level(s, &s->log_level, "Log level"); 529 548 u_var_add_bool(s, &s->exit_on_disconnect, "exit_on_disconnect"); ··· 543 562 } 544 563 545 564 return 0; 546 - } 547 - 548 - static void 549 - init_server_state(struct ipc_server *s) 550 - { 551 - // set up initial state for global vars, and each client state 552 - 553 - s->global_state.active_client_index = -1; // we start off with no active client. 554 - s->global_state.last_active_client_index = -1; 555 - s->current_slot_index = 0; 556 - 557 - for (uint32_t i = 0; i < IPC_MAX_CLIENTS; i++) { 558 - volatile struct ipc_client_state *ics = &s->threads[i].ics; 559 - ics->server = s; 560 - ics->server_thread_index = -1; 561 - } 562 565 } 563 566 564 567 ··· 924 927 return ret; 925 928 } 926 929 927 - init_server_state(s); 928 - 929 930 u_debug_gui_start(s->debug_gui, s->xinst, s->xsysd); 930 931 931 932 ret = main_loop(s); ··· 958 959 startup_complete_callback(data); 959 960 return ret; 960 961 } 961 - 962 - init_server_state(s); 963 962 964 963 *ps = s; 965 964 startup_complete_callback(data);