From 557a0fb4998f26751336eaf12402dc2e5223a018 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 8 Jun 2021 09:23:23 +0200 Subject: [PATCH] actor-remove-exit-hook! --- syndicate/actor.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syndicate/actor.rkt b/syndicate/actor.rkt index 0537430..6e43675 100644 --- a/syndicate/actor.rkt +++ b/syndicate/actor.rkt @@ -19,6 +19,7 @@ actor-daemon? actor-exit-reason actor-add-exit-hook! + actor-remove-exit-hook! actor-daemon! facet? @@ -155,6 +156,10 @@ (define (actor-add-exit-hook! ac hook) (set-actor-exit-hooks! ac (cons hook (actor-exit-hooks ac)))) +(define (actor-remove-exit-hook! ac hook) + (set-actor-exit-hooks! ac (filter (lambda (h) (not (eq? h hook))) + (actor-exit-hooks ac)))) + (define (actor-daemon! ac daemon?) (when (not (eq? daemon? (actor-daemon? ac))) (set-actor-daemon?! ac daemon?)