diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2022-03-25 19:02:53 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-26 00:04:15 +0100 |
commit | 9dcba0ba08d0e843eda1f141c99c72e0aa67811f (patch) | |
tree | 8fadb67cc9682f65c3b5078ab4acac832bf832ee /fsmonitor--daemon.h | |
parent | compat/fsmonitor/fsm-listen-darwin: stub in backend for Darwin (diff) | |
download | git-9dcba0ba08d0e843eda1f141c99c72e0aa67811f.tar.xz git-9dcba0ba08d0e843eda1f141c99c72e0aa67811f.zip |
fsmonitor--daemon: implement 'run' command
Implement `run` command to try to begin listening for file system events.
This version defines the thread structure with a single fsmonitor_fs_listen
thread to watch for file system events and a simple IPC thread pool to
watch for connection from Git clients over a well-known named pipe or
Unix domain socket.
This commit does not actually do anything yet because the platform
backends are still just stubs.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsmonitor--daemon.h')
-rw-r--r-- | fsmonitor--daemon.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/fsmonitor--daemon.h b/fsmonitor--daemon.h new file mode 100644 index 0000000000..3009c1a83d --- /dev/null +++ b/fsmonitor--daemon.h @@ -0,0 +1,34 @@ +#ifndef FSMONITOR_DAEMON_H +#define FSMONITOR_DAEMON_H + +#ifdef HAVE_FSMONITOR_DAEMON_BACKEND + +#include "cache.h" +#include "dir.h" +#include "run-command.h" +#include "simple-ipc.h" +#include "thread-utils.h" + +struct fsmonitor_batch; +struct fsmonitor_token_data; + +struct fsmonitor_daemon_backend_data; /* opaque platform-specific data */ + +struct fsmonitor_daemon_state { + pthread_t listener_thread; + pthread_mutex_t main_lock; + + struct strbuf path_worktree_watch; + struct strbuf path_gitdir_watch; + int nr_paths_watching; + + struct fsmonitor_token_data *current_token_data; + + int error_code; + struct fsmonitor_daemon_backend_data *backend_data; + + struct ipc_server_data *ipc_server_data; +}; + +#endif /* HAVE_FSMONITOR_DAEMON_BACKEND */ +#endif /* FSMONITOR_DAEMON_H */ |