aboutsummaryrefslogtreecommitdiff
path: root/gnu/gnunet/mq/envelope.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/gnunet/mq/envelope.scm')
-rw-r--r--gnu/gnunet/mq/envelope.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/gnu/gnunet/mq/envelope.scm b/gnu/gnunet/mq/envelope.scm
index e3788af..14d8b66 100644
--- a/gnu/gnunet/mq/envelope.scm
+++ b/gnu/gnunet/mq/envelope.scm
@@ -1,5 +1,5 @@
1;; This file is part of GNUnet. 1;; This file is part of GNUnet.
2;; Copyright (C) 2012-2019, 2021 GNUnet e.V. 2;; Copyright © 2012-2019, 2021, 2022 GNUnet e.V.
3;; 3;;
4;; GNUnet is free software: you can redistribute it and/or modify it 4;; GNUnet is free software: you can redistribute it and/or modify it
5;; under the terms of the GNU Affero General Public License as published 5;; under the terms of the GNU Affero General Public License as published
@@ -27,6 +27,7 @@
27 (export <envelope> make-envelope envelope? 27 (export <envelope> make-envelope envelope?
28 attempt-cancel! attempt-irrevocable-sent! 28 attempt-cancel! attempt-irrevocable-sent!
29 envelope-peek-cancelled? 29 envelope-peek-cancelled?
30 envelope-peek-irrevocably-sent?
30 ;; TODO find a better place 31 ;; TODO find a better place
31 (rename (bind-atomic-boxen %%bind-atomic-boxen))) 32 (rename (bind-atomic-boxen %%bind-atomic-boxen)))
32 (import (gnu gnunet utils hat-let) 33 (import (gnu gnunet utils hat-let)
@@ -73,6 +74,10 @@ When being marked as cancelled, the thunk @var{cancel!} is called."
73 "Test whether @var{envelope} is currently cancelled (true / false)." 74 "Test whether @var{envelope} is currently cancelled (true / false)."
74 (eq? #t (atomic-box-ref (%cancellation-state envelope)))) 75 (eq? #t (atomic-box-ref (%cancellation-state envelope))))
75 76
77 (define (envelope-peek-irrevocably-sent? envelope)
78 "Test whether @var{envelope} has been irrevocably sent (true / false)."
79 (eq? #false (atomic-box-ref (%cancellation-state envelope))))
80
76 (define (%attempt-irrevocable-sent! envelope already-sent go cancelled) 81 (define (%attempt-irrevocable-sent! envelope already-sent go cancelled)
77 (bind-atomic-boxen 82 (bind-atomic-boxen
78 ((state (%cancellation-state envelope) swap!)) 83 ((state (%cancellation-state envelope) swap!))