cs & threads: another spurious-CAS-failure accomodation

This commit is contained in:
Matthew Flatt 2020-06-29 10:11:10 -06:00
parent f38ffc53ed
commit 1118705bef

View File

@ -57,6 +57,10 @@
(loop))))
(define (lock-release lock)
(unless (box-cas! lock 1 0)
(internal-error "lock release failed!"))
(end-future-uninterrupted))
(cond
[(box-cas! lock 1 0)
(end-future-uninterrupted)]
[(eq? (unbox lock) 0)
;; not just a spurious failure...
(internal-error "lock release failed!")]
[else (lock-release lock)]))