mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-02 02:10:19 +02:00
guardians: speed up atomic fifo
* module/ice-9/guardians.scm (make-atomic-fifo): Instead of transferring the last element to the outbox, just return it.
This commit is contained in:
parent
8b46c321e5
commit
4c76332570
1 changed files with 2 additions and 2 deletions
|
@ -65,6 +65,7 @@
|
|||
(define (transfer! in out)
|
||||
(match in
|
||||
(() (values))
|
||||
((x) x)
|
||||
((x . in*)
|
||||
(let* ((out* (cons x out))
|
||||
(out** (atomic-box-compare-and-swap! outbox out out*)))
|
||||
|
@ -83,8 +84,7 @@
|
|||
(match (atomic-box-swap! inbox '())
|
||||
(() #f)
|
||||
(in
|
||||
(transfer! in '())
|
||||
(pop!)))))))
|
||||
(transfer! in '())))))))
|
||||
(values push! pop!))
|
||||
|
||||
(define (make-guardian)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue