mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-19 04:41:15 -03:00
fd_monitor is used when an external command pipes into a buffer, e.g. for command substitutions. It monitors the read end of the external command's pipe in the background, and fills the buffer as data arrives. fd_monitor is multiplexed, so multiple buffers can be monitored at once by a single thread. It may happen that there's no active buffer fill; in this case fd_monitor wants to keep its thread alive for a little bit in case a new one arrives. This is useful for e.g. handling loops where you run the same command multiple times. However there was a bug due to a refactoring which caused fd_monitor to exit too aggressively. This didn't affect correctness but it meant more thread creation and teardown. Fix this; this improves the aliases.fish benchmark by about 20 msec. No need to changelog this IMO.
7.6 KiB
7.6 KiB