b0226007f0
Replace the call to `FSEventStreamScheduleWithRunLoop()` function with the suggested `FSEventStreamSetDispatchQueue()` function. The MacOS version of the builtin FSMonitor feature uses the `FSEventStreamScheduleWithRunLoop()` function to drive the event loop and process FSEvents from the system. This routine has now been deprecated by Apple. The MacOS 13 (Ventura) compiler tool chain now generates a warning when compiling calls to this function. In DEVELOPER=1 mode, this now causes a compile error. The `FSEventStreamSetDispatchQueue()` function is conceptually similar and is the suggested replacement. However, there are some subtle thread-related differences. Previously, the event stream would be processed by the `fsm_listen__loop()` thread while it was in the `CFRunLoopRun()` method. (Conceptually, this was a blocking call on the lifetime of the event stream where our thread drove the event loop and individual events were handled by the `fsevent_callback()`.) With the change, a "dispatch queue" is created and FSEvents will be processed by a hidden queue-related thread (that calls the `fsevent_callback()` on our behalf). Our `fsm_listen__loop()` thread maintains the original blocking model by waiting on a mutex/condition variable pair while the hidden thread does all of the work. While the deprecated API used by the original were introduced in macOS 10.5 (Oct 2007), the API used by the updated code were introduced back in macOS 10.6 (Aug 2009) and has been available since then. So this change _could_ break those who have happily been using 10.5 (if there were such people), but these two dates both predate the oldest versions of macOS Apple seems to support anyway, so we should be safe. Signed-off-by: Jeff Hostetler <jeffhostetler@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
fsmonitor | ||
linux | ||
nedmalloc | ||
poll | ||
regex | ||
simple-ipc | ||
stub | ||
vcbuild | ||
win32 | ||
.gitattributes | ||
access.c | ||
apple-common-crypto.h | ||
basename.c | ||
bswap.h | ||
compiler.h | ||
disk.h | ||
fileno.c | ||
fopen.c | ||
hstrerror.c | ||
inet_ntop.c | ||
inet_pton.c | ||
memmem.c | ||
mingw.c | ||
mingw.h | ||
mkdir.c | ||
mkdtemp.c | ||
mmap.c | ||
msvc.c | ||
msvc.h | ||
nonblock.c | ||
nonblock.h | ||
obstack.c | ||
obstack.h | ||
open.c | ||
pread.c | ||
precompose_utf8.c | ||
precompose_utf8.h | ||
qsort_s.c | ||
setenv.c | ||
sha1-chunked.c | ||
sha1-chunked.h | ||
snprintf.c | ||
stat.c | ||
strcasestr.c | ||
strdup.c | ||
strlcpy.c | ||
strtoimax.c | ||
strtoumax.c | ||
terminal.c | ||
terminal.h | ||
unsetenv.c | ||
win32.h | ||
win32mmap.c | ||
winansi.c | ||
zlib-uncompress2.c |