guile-devel
[Top][All Lists]
Advanced

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

Re: a little puzzle


From: Andy Wingo
Subject: Re: a little puzzle
Date: Fri, 08 Oct 2010 19:32:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Fri 08 Oct 2010 19:14, Andy Wingo <address@hidden> writes:

>     ERROR: In procedure accept:
>     ERROR: Interrupted system call
>     Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
>     scheme@(guile-user) [1]> 
>     Throw to key `foo' with args `()' while reading expression.
>     scheme@(guile-user) [1]> 
>
> That's right: two throws for the price of one! The interrupted syscall,
> and then the asynchronous signal. Fun...

I propose to fix it with a patch like this:

--- a/libguile/error.c
+++ b/libguile/error.c
@@ -147,6 +147,7 @@ void
 scm_syserror (const char *subr)
 {
   SCM err = scm_from_int (SCM_I_ERRNO ());
+  SCM_ASYNC_TICK;
   scm_error (scm_system_error_key,
             subr,
             "~A",
@@ -157,6 +158,7 @@ scm_syserror (const char *subr)
 void
 scm_syserror_msg (const char *subr, const char *message, SCM args, int eno)
 {
+  SCM_ASYNC_TICK;
   scm_error (scm_system_error_key,
             subr,
             message,

I am not clear that it's guaranteed that the thread will be ready for an
async though. This seems to work but it does not seem reliable.

Andy
-- 
http://wingolog.org/



reply via email to

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