From 881547dc39f232b67ae348421d518f8dcf23bb62 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 9 Jul 2015 19:17:10 -0700 Subject: [PATCH] mhash: Assume GC daemon must lock out other threads. --- src/mhash/mhash.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mhash/mhash.scm b/src/mhash/mhash.scm index fc0da45a4..740123e08 100644 --- a/src/mhash/mhash.scm +++ b/src/mhash/mhash.scm @@ -115,10 +115,13 @@ USA. (loop next prev))))))) (define (cleanup-mhash-contexts) - (if (not (thread-mutex-owner mhash-contexts-mutex)) - (begin - (cleanup-contexts) - (cleanup-hmac-contexts)))) + (with-thread-mutex-try-lock + mhash-contexts-mutex + (lambda () + (cleanup-contexts) + (cleanup-hmac-contexts)) + (lambda () + unspecific))) (define (mhash-name->id name procedure) (let ((n (vector-length mhash-algorithm-names))) -- 2.25.1