From: Matt Birkholz Date: Thu, 23 Jul 2015 00:46:04 +0000 (-0700) Subject: Make fasload.o state single-threaded. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1037e1e8ff896fda1741a84ed5ba0faa1d59a14e;p=mit-scheme.git Make fasload.o state single-threaded. --- diff --git a/src/runtime/load.scm b/src/runtime/load.scm index 37272f956..59604d05a 100644 --- a/src/runtime/load.scm +++ b/src/runtime/load.scm @@ -37,6 +37,7 @@ USA. (set! load/loading? (make-fluid #f)) (set! load/suppress-loading-message? (make-fluid #f)) (set! load/after-load-hooks (make-fluid '())) + (set! fasload-mutex (make-thread-mutex)) (set! *eval-unit* (make-fluid #f)) (set! *current-load-environment* (make-fluid 'NONE)) (set! *write-notifications?* (make-fluid #t)) @@ -162,13 +163,17 @@ USA. notifier)) (values #f #f #f)))) +(define fasload-mutex) + (define (try-fasl-file pathname) (and (fasl-file? pathname) (lambda () (values pathname (lambda () - ((ucode-primitive binary-fasload) - (->namestring pathname))) + (with-thread-mutex-lock fasload-mutex + (lambda () + ((ucode-primitive binary-fasload) + (->namestring pathname))))) (let ((notifier (loading-notifier pathname))) (lambda (thunk) (if (file-modification-time