From: Matt Birkholz Date: Sun, 12 Jul 2015 22:10:53 +0000 (-0700) Subject: mhash: Prepare the GC daemon to run concurrently with other threads. X-Git-Tag: mit-scheme-pucked-9.2.12~376^2~62 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d9c4f61574a87cc653cbcfcbe6952b5485891004;p=mit-scheme.git mhash: Prepare the GC daemon to run concurrently with 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)))