From: Jeff Hostetler Date: Thu, 03 Mar 2022 16:50:24 GMT Subject: Re: [PATCH 17/23] fsmonitor--daemon: stub in health thread Message-ID: <3ac0116c-4d82-55d0-6e17-75c3de392bbf@jeffhostetler.com> In-Reply-To: On 2/24/22 11:15 AM, Derrick Stolee wrote: > On 2/24/2022 11:04 AM, Derrick Stolee wrote: >> On 2/15/2022 10:59 AM, Jeff Hostetler via GitGitGadget wrote: >>> From: Jeff Hostetler >>> >>> 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. >> >> ... >> >>> diff --git a/compat/fsmonitor/fsm-health-darwin.c b/compat/fsmonitor/fsm-health-darwin.c >>> new file mode 100644 >>> index 00000000000..b9f709e8548 >>> --- /dev/null >>> +++ b/compat/fsmonitor/fsm-health-darwin.c >>> @@ -0,0 +1,24 @@ >>> +#include "cache.h" >>> +#include "config.h" >>> +#include "fsmonitor.h" >>> +#include "fsm-health.h" >>> +#include "fsmonitor--daemon.h" >>> + >>> +int fsm_health__ctor(struct fsmonitor_daemon_state *state) >>> +{ >>> + return 0; >>> +} >>> + >>> +void fsm_health__dtor(struct fsmonitor_daemon_state *state) >>> +{ >>> + return; >>> +} >>> + >>> +void fsm_health__loop(struct fsmonitor_daemon_state *state) >>> +{ >>> + return; >>> +} >>> + >>> +void fsm_health__stop_async(struct fsmonitor_daemon_state *state) >>> +{ >>> +} >> >> The macOS implementation is stubbed, as advertised. > > After looking at the rest of the patch series, it seems that these > are never filled in. Are some of the win32 health monitors also > appropriate for macOS? (They would need platform-specific checks, > probably.) Yes, there are some asymmetries here. For example: On MacOS we get a notification at part of the existing watch if the repo root directory is moved or renamed, so (in a later commit) we can add code to the listener thread to check for that; however, on Windows we don't, so we have to poll for it in the health thread using timers and the BY_HANDLE_FILE_INFORMATION data. Here I'm just stubbing in a trivial health thread so that the framework is complete for the supported platforms. Thanks, Jeff