[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
}
- [Guile-commits] branch master updated (eeeee32 -> fcc6a7b), Andy Wingo, 2016/11/01
- [Guile-commits] 04/17: sigaction critical section refactor.,
Andy Wingo <=
- [Guile-commits] 06/17: Remove unused internal definitions, Andy Wingo, 2016/11/01
- [Guile-commits] 13/17: Mutex in dynamic linker, Andy Wingo, 2016/11/01
- [Guile-commits] 11/17: Mutex instead of critical section in gc.c, Andy Wingo, 2016/11/01
- [Guile-commits] 16/17: Threads no longer track critical section level, Andy Wingo, 2016/11/01
- [Guile-commits] 03/17: threads: Use a mutex instead of a critical section., Andy Wingo, 2016/11/01
- [Guile-commits] 07/17: Mutexes instead of critical sections in stime.c, Andy Wingo, 2016/11/01
- [Guile-commits] 01/17: api-scheduling.texi: Syntactic cleanups., Andy Wingo, 2016/11/01
- [Guile-commits] 08/17: Mutex instead of critical sectoin in symbol->keyword, Andy Wingo, 2016/11/01
- [Guile-commits] 05/17: regexec comment fix, Andy Wingo, 2016/11/01
- [Guile-commits] 15/17: Remove call/cc assertion about critical sections, Andy Wingo, 2016/11/01