Use internal mutation instead of re-parameterization
This commit is contained in:
parent
c5643fb1b1
commit
51422d2450
|
@ -78,7 +78,7 @@
|
||||||
(struct outbound-assertion (handle peer [established? #:mutable]))
|
(struct outbound-assertion (handle peer [established? #:mutable]))
|
||||||
|
|
||||||
(struct turn (id
|
(struct turn (id
|
||||||
active-facet
|
[active-facet #:mutable]
|
||||||
[queues #:mutable])
|
[queues #:mutable])
|
||||||
#:methods gen:custom-write
|
#:methods gen:custom-write
|
||||||
[(define (write-proc t port mode)
|
[(define (write-proc t port mode)
|
||||||
|
@ -317,9 +317,11 @@
|
||||||
(log-syndicate/actor-debug "end turn ~v\n" f)))
|
(log-syndicate/actor-debug "end turn ~v\n" f)))
|
||||||
|
|
||||||
(define (with-active-facet f action)
|
(define (with-active-facet f action)
|
||||||
(let ((inner-turn (turn (generate-turn-id) f (turn-queues (current-turn)))))
|
(let* ((t (current-turn))
|
||||||
(parameterize ((current-turn inner-turn)) (action))
|
(saved-f (turn-active-facet t)))
|
||||||
(set-turn-queues! inner-turn #f)))
|
(set-turn-active-facet! t f)
|
||||||
|
(action)
|
||||||
|
(set-turn-active-facet! t saved-f)))
|
||||||
|
|
||||||
(define (turn-enqueue! turn f action)
|
(define (turn-enqueue! turn f action)
|
||||||
(define qs (turn-queues turn))
|
(define qs (turn-queues turn))
|
||||||
|
|
Loading…
Reference in New Issue