|
Monado OpenXR Runtime
|
IPC client thread shutdown and blocking I/O cancellation. More...

Go to the source code of this file.
Functions | |
| void | ipc_server_client_thread_set_running (struct ipc_server *s, struct ipc_thread *it) |
| Do not revive a starting thread that shutdown has already stopped. | |
| bool | ipc_server_client_thread_is_running (struct ipc_server *s, struct ipc_thread *it) |
| Read the loop state under the same lock used to stop or start it. | |
| void | ipc_server_stop_and_join_client_threads (struct ipc_server *s) |
| Stop all client loops, wake blocking I/O, then join each thread once. | |
IPC client thread shutdown and blocking I/O cancellation.
| bool ipc_server_client_thread_is_running | ( | struct ipc_server * | s, |
| struct ipc_thread * | it | ||
| ) |
Read the loop state under the same lock used to stop or start it.
References ipc_server::lock.
| void ipc_server_client_thread_set_running | ( | struct ipc_server * | s, |
| struct ipc_thread * | it | ||
| ) |
Do not revive a starting thread that shutdown has already stopped.
References ipc_server::lock.
| void ipc_server_stop_and_join_client_threads | ( | struct ipc_server * | s | ) |
Stop all client loops, wake blocking I/O, then join each thread once.
Called by the server main thread after it stops accepting connections. Joining finishes client cleanup before the caller destroys server resources or restarts the main loop. Calls must be serialized on that main thread. Safe to repeat: joined slots are READY and no longer own a thread.
Stop all client loops, wake blocking I/O, then join each thread once.
Client threads may still be inside common_shutdown(), which destroys each client's compositor and dereferences s->xsysd / s->xso. Joining them before teardown_all() destroys those resources avoids a race where a client thread locks a mutex that teardown has already freed (observed as an om->initialized assertion in multi_compositor_destroy).
Stop their loops before joining, then wake every thread blocked in client I/O with ipc_server_cancel_all_client_io. That covers the Windows loop's ReadFile() and handlers stuck mid-message on any platform.
Called from shutdown_clients() before the main loop returns, and again from teardown_all() as a fallback.
References ipc_server_cancel_all_client_io(), and ipc_server::lock.