aboutsummaryrefslogtreecommitdiff
path: root/alloc.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-04-19 16:13:26 -0700
committerJunio C Hamano <gitster@pobox.com>2017-04-20 17:55:32 -0700
commite503cd6ed336d70d716e194ef6c5469330bea9da (patch)
tree85e6ecdb24137b1d66f336f2e7efbe5615edc468 /alloc.c
parent53fa6753b30c4fb4ea768d16d41d723ea19a3b00 (diff)
downloadgit-e503cd6ed336d70d716e194ef6c5469330bea9da.tar.gz
git-e503cd6ed336d70d716e194ef6c5469330bea9da.tar.xz
run-command: add note about forking and threading
All non-Async-Signal-Safe functions (e.g. malloc and die) were removed between 'fork' and 'exec' in start_command in order to avoid potential deadlocking when forking while multiple threads are running. This deadlocking is possible when a thread (other than the one forking) has acquired a lock and didn't get around to releasing it before the fork. This leaves the lock in a locked state in the resulting process with no hope of it ever being released. Add a note describing this potential pitfall before the call to 'fork()' so people working in this section of the code know to only use Async-Signal-Safe functions in the child process. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'alloc.c')
0 files changed, 0 insertions, 0 deletions