aboutsummaryrefslogtreecommitdiffstats
path: root/simple-ipc.h
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-10-15 16:56:43 -0400
committerTaylor Blau <me@ttaylorr.com>2024-10-15 16:56:43 -0400
commitb43e23fa02427067ceb605a5dd5ea602de4c6ac5 (patch)
treef3807a33e9cd06c829fdb1262a52eeb594f81920 /simple-ipc.h
parentMerge branch 'xx/remote-server-option-config' (diff)
parentfsmonitor: initialize fs event listener before accepting clients (diff)
downloadgit-b43e23fa02427067ceb605a5dd5ea602de4c6ac5.tar.gz
git-b43e23fa02427067ceb605a5dd5ea602de4c6ac5.zip
Merge branch 'jk/fsmonitor-event-listener-race-fix'
On macOS, fsmonitor can fall into a race condition that results in a client waiting forever to be notified for an event that have already happened. This problem has been corrected. * jk/fsmonitor-event-listener-race-fix: fsmonitor: initialize fs event listener before accepting clients simple-ipc: split async server initialization and running
Diffstat (limited to 'simple-ipc.h')
-rw-r--r--simple-ipc.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/simple-ipc.h b/simple-ipc.h
index a849d9f841..3916eaf70d 100644
--- a/simple-ipc.h
+++ b/simple-ipc.h
@@ -179,11 +179,20 @@ struct ipc_server_opts
* When a client IPC message is received, the `application_cb` will be
* called (possibly on a random thread) to handle the message and
* optionally compose a reply message.
+ *
+ * This initializes all threads but no actual work will be done until
+ * ipc_server_start_async() is called.
+ */
+int ipc_server_init_async(struct ipc_server_data **returned_server_data,
+ const char *path, const struct ipc_server_opts *opts,
+ ipc_server_application_cb *application_cb,
+ void *application_data);
+
+/*
+ * Let an async server start running. This needs to be called only once
+ * after initialization.
*/
-int ipc_server_run_async(struct ipc_server_data **returned_server_data,
- const char *path, const struct ipc_server_opts *opts,
- ipc_server_application_cb *application_cb,
- void *application_data);
+void ipc_server_start_async(struct ipc_server_data *server_data);
/*
* Gently signal the IPC server pool to shutdown. No new client