diff options
author | Brandon Williams <bmwill@google.com> | 2017-04-19 16:13:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-20 17:55:32 -0700 |
commit | e503cd6ed336d70d716e194ef6c5469330bea9da (patch) | |
tree | 85e6ecdb24137b1d66f336f2e7efbe5615edc468 /bulk-checkin.h | |
parent | run-command: handle dup2 and close errors in child (diff) | |
download | tgif-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 'bulk-checkin.h')
0 files changed, 0 insertions, 0 deletions