guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 04/17: sigaction critical section refactor.


From: Andy Wingo
Subject: [Guile-commits] 04/17: sigaction critical section refactor.
Date: Tue, 1 Nov 2016 22:50:44 +0000 (UTC)

wingo pushed a commit to branch master
in repository guile.

commit 465466ce4dcb0ca10e9efb3d0746fcee11a96b3f
Author: Andy Wingo <address@hidden>
Date:   Tue Nov 1 21:40:34 2016 +0100

    sigaction critical section refactor.
    
    * libguile/scmsigs.c (scm_sigaction_for_thread): Use critical section
      dynwinds instead of SCM_CRITICAL_SECTION_START.
---
 libguile/scmsigs.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index b030b04..d52fe8c 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -334,7 +334,9 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
 
   scm_i_ensure_signal_delivery_thread ();
 
-  SCM_CRITICAL_SECTION_START;
+  scm_dynwind_begin (0);
+  scm_dynwind_critical_section (SCM_BOOL_F);
+
   old_handler = SCM_SIMPLE_VECTOR_REF (*signal_handlers, csig);
   if (SCM_UNBNDP (handler))
     query_only = 1;
@@ -353,7 +355,6 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
        }
       else
        {
-         SCM_CRITICAL_SECTION_END;
          SCM_OUT_OF_RANGE (2, handler);
        }
     }
@@ -440,7 +441,9 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
     }
   if (old_action.sa_handler == SIG_DFL || old_action.sa_handler == SIG_IGN)
     old_handler = scm_from_long ((long) old_action.sa_handler);
-  SCM_CRITICAL_SECTION_END;
+
+  scm_dynwind_end ();
+
   return scm_cons (old_handler, scm_from_int (old_action.sa_flags));
 #else
   if (query_only)
@@ -459,7 +462,9 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
     }
   if (old_chandler == SIG_DFL || old_chandler == SIG_IGN)
     old_handler = scm_from_long ((long) old_chandler);
-  SCM_CRITICAL_SECTION_END;
+
+  scm_dynwind_end ();
+
   return scm_cons (old_handler, scm_from_int (0));
 #endif
 }



reply via email to

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