Must lock table during REHASH-TABLE!.
authorChris Hanson <org/chris-hanson/cph>
Sun, 13 Jun 2004 04:14:22 +0000 (04:14 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 13 Jun 2004 04:14:22 +0000 (04:14 +0000)
v7/src/runtime/hashtb.scm

index c25354c3219958723da211f479b25db83158c670..e6b1c2a47892cb13d9f685c74bbf0216716d81c9 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: hashtb.scm,v 1.30 2004/06/12 03:46:22 cph Exp $
+$Id: hashtb.scm,v 1.31 2004/06/13 04:14:22 cph Exp $
 
 Copyright 1990,1991,1993,1994,1995,2003 Massachusetts Institute of Technology
 Copyright 2004 Massachusetts Institute of Technology
@@ -609,10 +609,12 @@ USA.
            hash)))))
 
 (define (rehash-table! table)
-  (let ((entries (extract-table-entries! table)))
-    (set-table-needs-rehash?! table #f)
-    ((table-type-method:rehash! (table-type table)) table entries))
-  (maybe-shrink-table! table))
+  (with-table-locked! table
+    (lambda ()
+      (let ((entries (extract-table-entries! table)))
+       (set-table-needs-rehash?! table #f)
+       ((table-type-method:rehash! (table-type table)) table entries))
+      (maybe-shrink-table! table))))
 
 (define (extract-table-entries! table)
   (let ((buckets (table-buckets table)))