1.0.19.26: add THREAD-YIELD to GET-SPINLOCK
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 7 Aug 2008 14:44:57 +0000 (14:44 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 7 Aug 2008 14:44:57 +0000 (14:44 +0000)
 * Slightly less catastrophic.

src/code/target-thread.lisp
version.lisp-expr

index c37afef..27e686c 100644 (file)
@@ -204,8 +204,9 @@ in future versions."
         (error "Recursive lock attempt on ~S." spinlock))
       #!+sb-thread
       (flet ((cas ()
-               (unless (sb!ext:compare-and-swap (spinlock-value spinlock) nil new)
-                 (return-from get-spinlock t))))
+               (if (sb!ext:compare-and-swap (spinlock-value spinlock) nil new)
+                   (thread-yield)
+                   (return-from get-spinlock t))))
         (if (and (not *interrupts-enabled*) *allow-with-interrupts*)
             ;; If interrupts are enabled, but we are allowed to enabled them,
             ;; check for pending interrupts every once in a while.
index 535806b..52e70ee 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.19.25"
+"1.0.19.26"