gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 08/16: nse/client: Make the <server> a <losable>.


From: gnunet
Subject: [gnunet-scheme] 08/16: nse/client: Make the <server> a <losable>.
Date: Wed, 27 Jul 2022 00:21:18 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit e130a0effa760ad624a092a7c601986fb4d1294d
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Jul 24 00:35:40 2022 +0200

    nse/client: Make the <server> a <losable>.
    
    This is a start for making "garbage collectable" pass.
    
    * gnu/gnunet/nse/client.scm (<server>): Make the parent
    <losable>. Adjust protocol.
---
 gnu/gnunet/nse/client.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/gnunet/nse/client.scm b/gnu/gnunet/nse/client.scm
index c54d664..d4317d0 100644
--- a/gnu/gnunet/nse/client.scm
+++ b/gnu/gnunet/nse/client.scm
@@ -53,6 +53,8 @@
                symbol-value value->index)
          (only (guile)
                define* const)
+         (only (gnu gnunet concurrency lost-and-found)
+               make-lost-and-found <losable>)
          (only (gnu gnunet util struct)
                /:message-header)
          (only (gnu gnunet utils bv-slice)
@@ -81,6 +83,7 @@
       (opaque #t))
 
     (define-record-type (<server> %make-server server?)
+      (parent <losable>) ; for automatic fibers disposal when the <server> is 
unreachable
       ;; Atomic box of <estimate>
       (fields (immutable estimate/box server-estimate/box)
              ;; Atomic box of boolean.  Initially #f.  Set this
@@ -92,9 +95,10 @@
       (protocol
        (lambda (%make)
         (lambda ()
-          (%make (make-atomic-box #false)
-                 (make-atomic-box #false)
-                 (make-condition))))))
+          ((%make (make-lost-and-found))
+           (make-atomic-box #false)
+           (make-atomic-box #false)
+           (make-condition))))))
 
     (define (estimate server)
       "Return the current estimate of the number of peers on the network,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]