From: Matt Birkholz Date: Fri, 10 Jul 2015 02:17:10 +0000 (-0700) Subject: mhash: Assume GC daemon must lock out other threads. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=881547dc39f232b67ae348421d518f8dcf23bb62;p=mit-scheme.git mhash: Assume GC daemon must lock out other threads. --- 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)))