From 72751b72bf505f2fbb92c3bb4de906e713f5eba8 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 7 Aug 2008 14:44:57 +0000 Subject: [PATCH] 1.0.19.26: add THREAD-YIELD to GET-SPINLOCK * Slightly less catastrophic. --- src/code/target-thread.lisp | 5 +++-- version.lisp-expr | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp index c37afef..27e686c 100644 --- a/src/code/target-thread.lisp +++ b/src/code/target-thread.lisp @@ -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. diff --git a/version.lisp-expr b/version.lisp-expr index 535806b..52e70ee 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.19.25" +"1.0.19.26" -- 1.7.10.4