Make fasload.o state single-threaded.
authorMatt Birkholz <puck@birchwood-abbey.net>
Thu, 23 Jul 2015 00:46:04 +0000 (17:46 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Thu, 26 Nov 2015 08:09:46 +0000 (01:09 -0700)
src/runtime/load.scm

index 37272f956efe5d9c8b79d7524c37bdb94405e778..59604d05abd9d6a342e0a8c203c7dfba9252083d 100644 (file)
@@ -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<?