From: Chris Hanson Date: Sun, 13 Jun 2004 04:14:22 +0000 (+0000) Subject: Must lock table during REHASH-TABLE!. X-Git-Tag: 20090517-FFI~1638 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2dd44622b2c1457a13956378d66a24eabcf1f794;p=mit-scheme.git Must lock table during REHASH-TABLE!. --- diff --git a/v7/src/runtime/hashtb.scm b/v7/src/runtime/hashtb.scm index c25354c32..e6b1c2a47 100644 --- a/v7/src/runtime/hashtb.scm +++ b/v7/src/runtime/hashtb.scm @@ -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)))