guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. v2.1.0-119-g215fe3a


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-119-g215fe3a
Date: Tue, 08 Nov 2011 18:21:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=215fe3a89119319fa0bb953ede574b38bea143ab

The branch, master has been updated
       via  215fe3a89119319fa0bb953ede574b38bea143ab (commit)
       via  14dcb5ccd282622abd71aed3e41235d90f89d39d (commit)
      from  f209aeee9fc5032863cc07138be927da87d3a091 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 215fe3a89119319fa0bb953ede574b38bea143ab
Author: Andy Wingo <address@hidden>
Date:   Tue Nov 8 19:17:23 2011 +0100

    lock ports in `write' and `display'
    
    * libguile/print.c (scm_write, scm_display): Lock the port during
      `display' and `write' calls.  Fixes
      https://savannah.gnu.org/bugs/?33996.

commit 14dcb5ccd282622abd71aed3e41235d90f89d39d
Author: Andy Wingo <address@hidden>
Date:   Tue Nov 8 19:16:33 2011 +0100

    add scm_dynwind_lock_port
    
    * libguile/ports.h:
    * libguile/ports.c (scm_dynwind_lock_port): New function.

-----------------------------------------------------------------------

Summary of changes:
 libguile/ports.c |   26 ++++++++++++++++++++++++++
 libguile/ports.h |    1 +
 libguile/print.c |    8 ++++++++
 3 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/libguile/ports.c b/libguile/ports.c
index a95774b..bad524e 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -1098,6 +1098,32 @@ SCM_DEFINE (scm_set_port_conversion_strategy_x, 
"set-port-conversion-strategy!",
 
 
 
+/* The port lock.  */
+
+static void
+lock_port (SCM port)
+{
+  scm_c_lock_port (port);
+}
+
+static void
+unlock_port (SCM port)
+{
+  scm_c_unlock_port (port);
+}
+
+void
+scm_dynwind_lock_port (SCM port)
+{
+  scm_dynwind_unwind_handler_with_scm (unlock_port, port,
+                                       SCM_F_WIND_EXPLICITLY);
+  scm_dynwind_rewind_handler_with_scm (lock_port, port,
+                                       SCM_F_WIND_EXPLICITLY);
+}
+
+
+
+
 /* Revealed counts --- an oddity inherited from SCSH.  */
 
 /* Find a port in the table and return its revealed count.
diff --git a/libguile/ports.h b/libguile/ports.h
index 56cafdb..624b7b8 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -294,6 +294,7 @@ SCM_API SCM scm_port_conversion_strategy (SCM port);
 SCM_API SCM scm_set_port_conversion_strategy_x (SCM port, SCM behavior);
 
 /* Acquiring and releasing the port lock.  */
+SCM_API void scm_dynwind_lock_port (SCM port);
 SCM_INLINE int scm_c_lock_port (SCM port);
 SCM_INLINE int scm_c_try_lock_port (SCM port);
 SCM_INLINE int scm_c_unlock_port (SCM port);
diff --git a/libguile/print.c b/libguile/print.c
index 62cf2a1..6e1ff80 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -1294,7 +1294,11 @@ scm_write (SCM obj, SCM port)
 
   SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG2, s_write);
 
+  scm_dynwind_begin (0);
+  scm_dynwind_lock_port (port);
   scm_prin1 (obj, port, 1);
+  scm_dynwind_end ();
+
   return SCM_UNSPECIFIED;
 }
 
@@ -1309,7 +1313,11 @@ scm_display (SCM obj, SCM port)
 
   SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG2, s_display);
 
+  scm_dynwind_begin (0);
+  scm_dynwind_lock_port (port);
   scm_prin1 (obj, port, 0);
+  scm_dynwind_end ();
+
   return SCM_UNSPECIFIED;
 }
 


hooks/post-receive
-- 
GNU Guile



reply via email to

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