1.0.4.79: remove lock from *descriptor-handlers*
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 13 Apr 2007 10:22:30 +0000 (10:22 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 13 Apr 2007 10:22:30 +0000 (10:22 +0000)
 * Each thread binds it, so no locking required. WITHOUT-INTERRUPTS still
   needed, however.

NEWS
src/code/serve-event.lisp
src/code/target-package.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index eb6a9d6..0f25da1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,7 @@ changes in sbcl-1.0.5 relative to sbcl-1.0.4:
     to global variables using SYMBOL-VALUE and a constant argument.
   * enhancement: SIGINT now causes a specific condition
     SB-SYS:INTERACTIVE-INTERRUPT to be signalled.
-  * bug fix: adding and removing fd-handlers is now thread-safe.
+  * bug fix: adding and removing fd-handlers is now interrupt-safe.
   * bug fix: inlined calls to C now ensure 16byte stack alignment on
     x86/Darwin.
   * bug fix: bad type declaration in the CLOS implementation has
index 02358fb..50fce5d 100644 (file)
   #!+sb-doc
   "List of all the currently active handlers for file descriptors")
 
-(defvar *descriptor-handler-lock*
-  (sb!thread::make-spinlock :name "descriptor handle lock"))
-
 (sb!xc:defmacro with-descriptor-handlers (&body forms)
   ;; FD-STREAM functionality can add and remove descriptors on it's
-  ;; own, and two threads adding add the same time could lose one.
-  ;;
-  ;; This is never held for long, so a spinlock is fine.
-  `(without-interrupts
-     (sb!thread::with-spinlock (*descriptor-handler-lock*)
-       ,@forms)))
+  ;; own, so getting an interrupt while modifying this and the
+  ;; starting to recursively modify it could lose...
+  `(without-interrupts ,@forms))
 
 (defun list-all-descriptor-handlers ()
   (with-descriptor-handlers
index a8ccd00..a8598ad 100644 (file)
@@ -78,7 +78,7 @@
       res)))
 
 ;;; Destructively resize TABLE to have room for at least SIZE entries
-;;; and rehash its existing entries. 
+;;; and rehash its existing entries.
 (defun resize-package-hashtable (table size)
   (let* ((vec (package-hashtable-table table))
          (hash (package-hashtable-hash table))
index 1bf9991..245a14e 100644 (file)
@@ -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.4.78"
+"1.0.4.79"