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 turn (id
|
||||
active-facet
|
||||
[active-facet #:mutable]
|
||||
[queues #:mutable])
|
||||
#:methods gen:custom-write
|
||||
[(define (write-proc t port mode)
|
||||
|
@ -317,9 +317,11 @@
|
|||
(log-syndicate/actor-debug "end turn ~v\n" f)))
|
||||
|
||||
(define (with-active-facet f action)
|
||||
(let ((inner-turn (turn (generate-turn-id) f (turn-queues (current-turn)))))
|
||||
(parameterize ((current-turn inner-turn)) (action))
|
||||
(set-turn-queues! inner-turn #f)))
|
||||
(let* ((t (current-turn))
|
||||
(saved-f (turn-active-facet t)))
|
||||
(set-turn-active-facet! t f)
|
||||
(action)
|
||||
(set-turn-active-facet! t saved-f)))
|
||||
|
||||
(define (turn-enqueue! turn f action)
|
||||
(define qs (turn-queues turn))
|
||||
|
|
Loading…
Reference in New Issue