From 107c7358a693264e597c67cf9922f49d689dde6d Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 23 Dec 2012 12:53:34 +0400 Subject: [PATCH] Fix GC_print_trace missing unlock * mark.c (GC_print_trace): Perform UNLOCK (if "lock" is on) before return (inside loop). --- mark.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mark.c b/mark.c index cc8dfde9..6c870164 100644 --- a/mark.c +++ b/mark.c @@ -1479,7 +1479,10 @@ void GC_print_trace(word gc_no, GC_bool lock) for (i = GC_trace_buf_ptr-1; i != GC_trace_buf_ptr; i--) { if (i < 0) i = TRACE_ENTRIES-1; p = GC_trace_buf + i; - if (p -> gc_no < gc_no || p -> kind == 0) return; + if (p -> gc_no < gc_no || p -> kind == 0) { + if (lock) UNLOCK(); + return; + } printf("Trace:%s (gc:%u,bytes:%lu) 0x%X, 0x%X\n", p -> kind, (unsigned)p -> gc_no, (unsigned long)p -> bytes_allocd, -- 2.40.0