diff options
author | Jeff King <peff@peff.net> | 2013-04-16 15:46:22 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-16 15:02:46 -0700 |
commit | c19a490e37181de8fa94ae1074af4b9f9a518f95 (patch) | |
tree | 59751aaee7a5596494254f542cd8890135f44474 /git-compat-util.h | |
parent | 04a74b6cfa5ef4870263f84ac94a488d9f2ef14a (diff) | |
download | git-c19a490e37181de8fa94ae1074af4b9f9a518f95.tar.gz |
usage: allow pluggable die-recursion checks
When any git code calls die or die_errno, we use a counter
to detect recursion into the die functions from any of the
helper functions. However, such a simple counter is not good
enough for threaded programs, which may call die from a
sub-thread, killing only the sub-thread (but incrementing
the counter for everyone).
Rather than try to deal with threads ourselves here, let's
just allow callers to plug in their own recursion-detection
function. This is similar to how we handle the die routine
(the caller plugs in a die routine which may kill only the
sub-thread).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 9c01e9bc2e..6aee9df868 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -301,6 +301,7 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))) extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params)); extern void set_error_routine(void (*routine)(const char *err, va_list params)); +extern void set_die_is_recursing_routine(int (*routine)(void)); extern int prefixcmp(const char *str, const char *prefix); extern int suffixcmp(const char *str, const char *suffix); |