diff options
author | Johannes Sixt <j6t@kdbg.org> | 2010-03-06 16:40:43 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-07 00:37:36 -0800 |
commit | 0ea1c89ba616397ef7e5f6f601ef7a24d2c27b8e (patch) | |
tree | be4b99aacc57c03083c5e199dd8a59457c068ed1 /contrib/stats | |
parent | Reimplement async procedures using pthreads (diff) | |
download | tgif-0ea1c89ba616397ef7e5f6f601ef7a24d2c27b8e.tar.xz |
Dying in an async procedure should only exit the thread, not the process.
Async procedures are intended as helpers that perform a very restricted
task, and the caller usually has to manage them in a larger context.
Conceptually, the async procedure is not concerned with the "bigger
picture" in whose context it is run. When it dies, it is not supposed
to destroy this "bigger picture", but rather only its own limit view
of the world. On POSIX, the async procedure is run in its own process,
and exiting this process naturally had only these limited effects.
On Windows (or when ASYNC_AS_THREAD is set), calling die() exited the
whole process, destroying the caller (the "big picture") as well.
This fixes it to exit only the thread.
Without ASYNC_AS_THREAD, one particular effect of exiting the async
procedure process is that it automatically closes file descriptors, most
notably the writable end of the pipe that the async procedure writes to.
The async API already requires that the async procedure closes the pipe
ends when it exits normally. But for calls to die() no requirements are
imposed. In the non-threaded case the pipe ends are closed implicitly
by the exiting process, but in the threaded case, the die routine must
take care of closing them.
Now t5530-upload-pack-error.sh passes on Windows.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/stats')
0 files changed, 0 insertions, 0 deletions