git/compat/fsmonitor
Jeff Hostetler d06055501b fsmonitor--daemon: stub in health thread
Create another thread to watch over the daemon process and
automatically shut it down if necessary.

This commit creates the basic framework for a "health" thread
to monitor the daemon and/or the file system.  Later commits
will add platform-specific code to do the actual work.

The "health" thread is intended to monitor conditions that
would be difficult to track inside the IPC thread pool and/or
the file system listener threads.  For example, when there are
file system events outside of the watched worktree root or if
we want to have an idle-timeout auto-shutdown feature.

This commit creates the health thread itself, defines the thread-proc
and sets up the thread's event loop.  It integrates this new thread
into the existing IPC and Listener thread models.

This commit defines the API to the platform-specific code where all of
the monitoring will actually happen.

The platform-specific code for MacOS is just stubs.  Meaning that the
health thread will immediately exit on MacOS, but that is OK and
expected.  Future work can define MacOS-specific monitoring.

The platform-specific code for Windows sets up enough of the
WaitForMultipleObjects() machinery to watch for system and/or custom
events.  Currently, the set of wait handles only includes our custom
shutdown event (sent from our other theads).  Later commits in this
series will extend the set of wait handles to monitor other
conditions.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-26 15:59:27 -07:00
..
fsm-darwin-gcc.h compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent 2022-03-25 16:04:16 -07:00
fsm-health-darwin.c fsmonitor--daemon: stub in health thread 2022-05-26 15:59:27 -07:00
fsm-health-win32.c fsmonitor--daemon: stub in health thread 2022-05-26 15:59:27 -07:00
fsm-health.h fsmonitor--daemon: stub in health thread 2022-05-26 15:59:27 -07:00
fsm-listen-darwin.c fsmonitor--daemon: rename listener thread related variables 2022-05-26 15:59:26 -07:00
fsm-listen-win32.c fsmonitor--daemon: rename listener thread related variables 2022-05-26 15:59:26 -07:00
fsm-listen.h fsmonitor--daemon: rename listener thread related variables 2022-05-26 15:59:26 -07:00
fsm-settings-darwin.c fsmonitor-settings: NTFS and FAT32 on MacOS are incompatible 2022-05-26 15:59:26 -07:00
fsm-settings-win32.c fsmonitor-settings: remote repos on Windows are incompatible 2022-05-26 15:59:26 -07:00