From 1037e1e8ff896fda1741a84ed5ba0faa1d59a14e Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 22 Jul 2015 17:46:04 -0700 Subject: [PATCH] Make fasload.o state single-threaded. --- src/runtime/load.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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