From: Jeff King Date: Tue, 16 Apr 2013 19:46:22 +0000 (-0400) Subject: usage: allow pluggable die-recursion checks X-Git-Tag: v1.8.2.2~1^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c19a490e37181de8fa94ae1074af4b9f9a518f95?ds=inline;hp=c19a490e37181de8fa94ae1074af4b9f9a518f95 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 Signed-off-by: Junio C Hamano ---