gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 194/324: mq-impl/stream: Eliminate atomic box.


From: gnunet
Subject: [gnunet-scheme] 194/324: mq-impl/stream: Eliminate atomic box.
Date: Tue, 21 Sep 2021 13:23:54 +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 4f9092cdd48f72e399dc1676544f99a213ce0449
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Aug 21 13:24:43 2021 +0200

    mq-impl/stream: Eliminate atomic box.
    
    A regular variable suffices.
    
    * gnu/gnunet/mq-impl/stream.scm
      (connect/fibers): Replace atomic box 'socket/box' with variable
      'socket'.  Don't use mutation.
---
 gnu/gnunet/mq-impl/stream.scm | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gnu/gnunet/mq-impl/stream.scm b/gnu/gnunet/mq-impl/stream.scm
index 2a56959..3e2158a 100644
--- a/gnu/gnunet/mq-impl/stream.scm
+++ b/gnu/gnunet/mq-impl/stream.scm
@@ -261,21 +261,15 @@ the error @code{input:regular-end-of-file} is injected 
into the message queue."
       ;; TODO ^^^^ stop the fibers when the server closed the connection.
 
       ;; TODO closing message queues
-      (define socket/box (make-atomic-box #f))
       (define rcvar (make-repeated-condition))
       (define (interrupt! mq)
        (trigger-condition! rcvar))
       (define wait! (cut await-trigger! rcvar))
       (let ((mq (make-message-queue handlers error-handler interrupt!)))
        (spawn (lambda ()
-                (atomic-box-set! socket/box
-                                 (connect-unix config service-name))
+                (define socket (connect-unix config service-name))
                 (inject-error! mq 'connection:connected)
-                (spawn
-                 (lambda ()
-                   (handle-input! mq (atomic-box-ref socket/box))))
-                (spawn
-                 (lambda ()
-                   (handle-output! mq (atomic-box-ref socket/box) wait!)))))
+                (spawn (lambda () (handle-input! mq socket)))
+                (spawn (lambda () (handle-output! mq socket wait!)))))
        mq))))
 

-- 
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]