msys-1.0.dll: Do not start the fstab observer thread.
To update mount points while an MSYS program is active, a thread is started
on program startup that observes fstab changes. On program shutdown, this
thread is nowhere terminated explicitly, but only implicitly by
ExitProcess(). Procmon reveals that this takes around 100ms.
The consequence is that when an MSYS program is started from CMD, it takes
at least 100ms, even if it does nothing, such as 'cat < nul'.
The mount point information is shared between MSYS processes, and only the
first one starts this thread and takes the penalty. This is commonly an
interactive bash: nobody cares that it takes 0.1sec to shut down because
all programs that it launches (and their child processes) are not
penalized. But if MSYS programs are run from CMD, the penalty is taken
every time.
This does make a difference when you have a clean or smudge filter
implemented as a bash script *and* you are working from CMD because each
invocation of the script (which happens for each file to which the filter
is applied) takes the penalty.
This patch disables the watcher thread by default, but it can be enabled
by setting the environment variable MSYS_WATCH_FSTAB to a non-empty string
(that does not start with a zero).
A workaround is to start 'cat' in a separate CMD and leave it waiting for
input. This 'cat' counts as the "first" MSYS program and takes the penalty;
all others, even when they are run from a different CMD, do not suffer.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>