Monado OpenXR Runtime
Loading...
Searching...
No Matches
ipc_server_thread_shutdown.h
Go to the documentation of this file.
1// Copyright 2026, Nick Kennedy
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief IPC client thread shutdown and blocking I/O cancellation.
6 * @author Nick Kennedy <code@nick-kennedy.com>
7 * @ingroup ipc_server
8 */
9
10#pragma once
11#include "xrt/xrt_config_os.h"
12
13#include <stdbool.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19struct ipc_server;
20struct ipc_thread;
21
22//! Do not revive a starting thread that shutdown has already stopped.
23void
25
26//! Read the loop state under the same lock used to stop or start it.
27bool
29
30/*!
31 * Stop all client loops, wake blocking I/O, then join each thread once.
32 * Called by the server main thread after it stops accepting connections.
33 * Joining finishes client cleanup before the caller destroys server resources or restarts the main loop.
34 * Calls must be serialized on that main thread. Safe to repeat: joined slots are READY and no longer own a thread.
35 */
36void
38
39#ifdef __cplusplus
40}
41#endif
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.
Definition ipc_server_thread_shutdown.c:57
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.
Definition ipc_server_thread_shutdown.c:67
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.
Definition ipc_server_thread_shutdown.c:92
Main IPC object for the server.
Definition ipc_server.h:388
Definition ipc_server.h:229
Auto detect OS and certain features.