path: root/Documentation
diff options
authorJohannes Sixt <>2010-03-06 15:40:43 (GMT)
committerJunio C Hamano <>2010-03-07 08:37:36 (GMT)
commit0ea1c89ba616397ef7e5f6f601ef7a24d2c27b8e (patch)
treebe4b99aacc57c03083c5e199dd8a59457c068ed1 /Documentation
parent200a76b74db5c2c75bcf73773cb85c5603ec038e (diff)
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 passes on Windows. Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions