summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 851c34b)
raw | patch | inline | side by side (parent: 851c34b)
author | Johannes Sixt <j6t@kdbg.org> | |
Sat, 8 May 2010 15:18:06 +0000 (17:18 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 9 May 2010 05:28:01 +0000 (22:28 -0700) |
This avoids a potential race condition when async procedures are
implemented as threads where release_pack_memory() can be called from
different threads without locking under memory pressure.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
implemented as threads where release_pack_memory() can be called from
different threads without locking under memory pressure.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
trace.c | patch | blob | history |
index 4229ae1231d69aedd9f1aa8350989ddbe2bdb845..1e560cb0b977e19beeb095497c8e4f6280b7f0d6 100644 (file)
--- a/trace.c
+++ b/trace.c
#include "cache.h"
#include "quote.h"
+void do_nothing(size_t unused)
+{
+}
+
/* Get a trace file descriptor from GIT_TRACE env variable. */
static int get_trace_fd(int *need_close)
{
if (!fd)
return;
+ set_try_to_free_routine(do_nothing); /* is never reset */
strbuf_init(&buf, 64);
va_start(ap, fmt);
len = vsnprintf(buf.buf, strbuf_avail(&buf), fmt, ap);
if (!fd)
return;
+ set_try_to_free_routine(do_nothing); /* is never reset */
strbuf_init(&buf, 64);
va_start(ap, fmt);
len = vsnprintf(buf.buf, strbuf_avail(&buf), fmt, ap);