Must disable interrupts for SET-ENTRY-DATUM!.
authorTaylor R Campbell <campbell@mumble.net>
Mon, 23 May 2011 15:34:10 +0000 (15:34 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Mon, 23 May 2011 15:34:10 +0000 (15:34 +0000)
It would probably be better to add a DISCRETIONARY-WITH-TABLE-LOCKED
operation to the entry type abstraction, so that the overhead of
blocking interrupts would be incurred only for key&datum-ephemeral
tables, which are the only ones that need it.

src/runtime/hashtb.scm

index 5675eed6968ef050f592acc8ec10e7af24a31c4c..feda12e743d282633b585692d88058b1d7cb6900 100644 (file)
@@ -626,8 +626,11 @@ USA.
              (lambda (key* barrier)
                (declare (integrate key* barrier))
                (if (key=? key* key)
-                   (begin (set-entry-datum! entry-type (car p) datum)
-                          (barrier))
+                   (begin
+                     (with-table-locked! table
+                       (lambda ()
+                         (set-entry-datum! entry-type (car p) datum)))
+                     (barrier))
                    (loop (cdr p) p)))
              (lambda () (loop (cdr p) p)))
            (with-table-locked! table