The open source OpenXR runtime
0
fork

Configure Feed

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

ipc: Rename client connected function and document code

authored by

Jakob Bornecrantz and committed by
Lubosz Sarnecki
2edf0774 0195e223

+21 -6
+7 -2
src/xrt/ipc/server/ipc_server.h
··· 431 431 * @{ 432 432 */ 433 433 /*! 434 - * Start a thread for a client connected at the other end of the ipc handle @p ipc_handle. 434 + * Called when a client has connected, it takes the client's ipc handle. 435 + * Handles all things needed to be done for a client connecting, like starting 436 + * it's thread. 437 + * 438 + * @param vs The IPC server. 439 + * @param ipc_handle Handle to communicate over. 435 440 * @memberof ipc_server 436 441 */ 437 442 void 438 - ipc_server_start_client_listener_thread(struct ipc_server *vs, xrt_ipc_handle_t ipc_handle); 443 + ipc_server_handle_client_connected(struct ipc_server *vs, xrt_ipc_handle_t ipc_handle); 439 444 440 445 /*! 441 446 * Perform whatever needs to be done when the mainloop polling encounters a failure.
+6 -1
src/xrt/ipc/server/ipc_server_mainloop_android.c
··· 91 91 if (read(ml->pipe_read, &newfd, sizeof(newfd)) == sizeof(newfd)) { 92 92 // client_push_mutex should prevent dropping acknowledgements 93 93 assert(ml->last_accepted_fd == 0); 94 + 94 95 // Release the thread that gave us this fd. 95 96 ml->last_accepted_fd = newfd; 96 - ipc_server_start_client_listener_thread(vs, newfd); 97 + 98 + // Call into the generic client connected handling code. 99 + ipc_server_handle_client_connected(vs, newfd); 100 + 101 + // If we are waiting to shutdown, wake that thread up. 97 102 pthread_cond_broadcast(&ml->accept_cond); 98 103 } else { 99 104 U_LOG_E("error on pipe read");
+3 -1
src/xrt/ipc/server/ipc_server_mainloop_linux.c
··· 211 211 ipc_server_handle_failure(vs); 212 212 return; 213 213 } 214 - ipc_server_start_client_listener_thread(vs, ret); 214 + 215 + // Call into the generic client connected handling code. 216 + ipc_server_handle_client_connected(vs, ret); 215 217 } 216 218 217 219 #define NUM_POLL_EVENTS 8
+4 -1
src/xrt/ipc/server/ipc_server_mainloop_windows.cpp
··· 192 192 193 193 bRet = SetNamedPipeHandleState(ml->pipe_handle, &mode, nullptr, nullptr); 194 194 if (bRet) { 195 - ipc_server_start_client_listener_thread(vs, ml->pipe_handle); 195 + // Call into the generic client connected handling code. 196 + ipc_server_handle_client_connected(vs, ml->pipe_handle); 197 + 198 + // Create another pipe to wait on. 196 199 create_another_pipe_instance(vs, ml); 197 200 return; 198 201 }
+1 -1
src/xrt/ipc/server/ipc_server_process.c
··· 385 385 } 386 386 387 387 void 388 - ipc_server_start_client_listener_thread(struct ipc_server *vs, xrt_ipc_handle_t ipc_handle) 388 + ipc_server_handle_client_connected(struct ipc_server *vs, xrt_ipc_handle_t ipc_handle) 389 389 { 390 390 volatile struct ipc_client_state *ics = NULL; 391 391 int32_t cs_index = -1;