summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-04-16 19:46:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-16 22:02:46 (GMT)
commitc19a490e37181de8fa94ae1074af4b9f9a518f95 (patch)
tree59751aaee7a5596494254f542cd8890135f44474 /git-compat-util.h
parent04a74b6cfa5ef4870263f84ac94a488d9f2ef14a (diff)
downloadgit-c19a490e37181de8fa94ae1074af4b9f9a518f95.zip
git-c19a490e37181de8fa94ae1074af4b9f9a518f95.tar.gz
git-c19a490e37181de8fa94ae1074af4b9f9a518f95.tar.bz2
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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 9c01e9b..6aee9df 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);