From 3918e3e232b5830ec1f0f7e6265b4b0c23fc16da Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 21 Dec 2008 15:03:11 +0000 Subject: [PATCH] 1.0.23.61: tweak concurrent hash-table access check * Moves the with-concurrent-access-check inside the body where the lock is already held. Patch by Attila Lendvai. * Fix various attributions in NEWS, caught by TCR. --- NEWS | 4 ++-- src/code/target-hash-table.lisp | 30 +++++++++++++++--------------- version.lisp-expr | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/NEWS b/NEWS index 8d233a1..e5f7394 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ * new feature: ARRAY-STORAGE-VECTOR provides access to the underlying data vector of an multidimensional SIMPLE-ARRAY. * new feature: the system now signals a continuable error if standard - readtable modification is attempted. + readtable modification is attempted. (thanks to Tobias Rittweiler) * optimization: faster generic arithmetic dispatch on x86 and x86-64. * optimization: FORMAT ~D and ~F are now approximately 5% faster. * tradeoff: constant FORMAT control strings are now compiled unless @@ -37,7 +37,7 @@ REPL unusable. (reported by Daniel Herring) * bug fix: return values of READ-SEQUENCE did not take :START into account on file streams, regressions since 1.0.12.22. (reported by - Daniel Herring, patch by Paul Huong) + Thomas Russ, patch by Paul Khuong) * bug fix: using SET or (SETF SYMBOL-VALUE) to change the value of a method specializer used to confuse permuation vector optimization. * bug fix: system inserted bogus implicit type declarations for local diff --git a/src/code/target-hash-table.lisp b/src/code/target-hash-table.lisp index 977d768..090606a 100644 --- a/src/code/target-hash-table.lisp +++ b/src/code/target-hash-table.lisp @@ -520,22 +520,22 @@ multiple threads accessing the same hash-table without locking." &body body) (declare (type (member :read :write) operation)) (with-unique-names (body-fun) - `(with-concurrent-access-check ,hash-table ,operation - (flet ((,body-fun () + `(flet ((,body-fun () + (with-concurrent-access-check ,hash-table ,operation (locally (declare (inline ,@inline)) - ,@body))) - (if (hash-table-weakness ,hash-table) - (sb!thread::with-recursive-system-spinlock - ((hash-table-spinlock ,hash-table) :without-gcing t) - (,body-fun)) - (with-pinned-objects ,pin - (if ,synchronized - ;; We use a "system" spinlock here because it is very - ;; slightly faster, as it doesn't re-enable interrupts. - (sb!thread::with-recursive-system-spinlock - ((hash-table-spinlock ,hash-table)) - (,body-fun)) - (,body-fun)))))))) + ,@body)))) + (if (hash-table-weakness ,hash-table) + (sb!thread::with-recursive-system-spinlock + ((hash-table-spinlock ,hash-table) :without-gcing t) + (,body-fun)) + (with-pinned-objects ,pin + (if ,synchronized + ;; We use a "system" spinlock here because it is very + ;; slightly faster, as it doesn't re-enable interrupts. + (sb!thread::with-recursive-system-spinlock + ((hash-table-spinlock ,hash-table)) + (,body-fun)) + (,body-fun))))))) (defun gethash (key hash-table &optional default) #!+sb-doc diff --git a/version.lisp-expr b/version.lisp-expr index 3b61640..a626923 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.23.60" +"1.0.23.61" -- 1.7.10.4