[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/05: Finalization thread exits when it gets EOF on its
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 01/05: Finalization thread exits when it gets EOF on its pipe. |
Date: |
Sat, 1 Oct 2022 10:02:00 -0400 (EDT) |
civodul pushed a commit to branch main
in repository guile.
commit df86a2a8c8725ac6244a222d399a5b959101f621
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Oct 1 15:28:41 2022 +0200
Finalization thread exits when it gets EOF on its pipe.
Avoids spurious "error in finalization thread: Success" messages when
the finalization pipe gets closed.
* libguile/finalizers.c (finalization_thread_proc): Return when 'data.n'
is zero.
---
libguile/finalizers.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/libguile/finalizers.c b/libguile/finalizers.c
index 5122e5fe3..1370755bf 100644
--- a/libguile/finalizers.c
+++ b/libguile/finalizers.c
@@ -1,4 +1,4 @@
-/* Copyright 2012-2014,2018-2020
+/* Copyright 2012-2014,2018-2020,2022
Free Software Foundation, Inc.
This file is part of Guile.
@@ -226,8 +226,11 @@ finalization_thread_proc (void *unused)
struct finalization_pipe_data data;
scm_without_guile (read_finalization_pipe_data, &data);
-
- if (data.n <= 0)
+
+ if (data.n == 0)
+ /* The other end of the pipe was closed, so exit. */
+ return NULL;
+ else if (data.n < 0)
{
if (data.err != EINTR)
{