[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 14/17: Remove last critical section use
From: |
Andy Wingo |
Subject: |
[Guile-commits] 14/17: Remove last critical section use |
Date: |
Tue, 1 Nov 2016 22:50:44 +0000 (UTC) |
wingo pushed a commit to branch master
in repository guile.
commit 65268ff37a89e02eddb5658c5c0e97ed9d0fe3c4
Author: Andy Wingo <address@hidden>
Date: Tue Nov 1 23:31:11 2016 +0100
Remove last critical section use
* libguile/scmsigs.c (signal_handler_lock): New variable.
(scm_sigaction_for_thread): Block asyncs and use a mutex instead of
using scm_dynwind_critical_section.
---
libguile/scmsigs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index d52fe8c..d852e71 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -86,6 +86,8 @@
signal_handler_threads points to the thread that a signal should be
delivered to.
*/
+static scm_i_pthread_mutex_t signal_handler_lock =
+ SCM_I_PTHREAD_MUTEX_INITIALIZER;
static SCM *signal_handlers;
static SCM signal_handler_asyncs;
static SCM signal_handler_threads;
@@ -335,7 +337,8 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
scm_i_ensure_signal_delivery_thread ();
scm_dynwind_begin (0);
- scm_dynwind_critical_section (SCM_BOOL_F);
+ scm_dynwind_pthread_mutex_lock (&signal_handler_lock);
+ scm_dynwind_block_asyncs ();
old_handler = SCM_SIMPLE_VECTOR_REF (*signal_handlers, csig);
if (SCM_UNBNDP (handler))
- [Guile-commits] 03/17: threads: Use a mutex instead of a critical section., (continued)
- [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
- [Guile-commits] 09/17: Simplify critical section implementation, Andy Wingo, 2016/11/01
- [Guile-commits] 10/17: Mutex instead of critical section in GOOPS, Andy Wingo, 2016/11/01
- [Guile-commits] 02/17: Add scm_yield to manual alongside yield, Andy Wingo, 2016/11/01
- [Guile-commits] 12/17: Remove critical section in scm_debug_options, Andy Wingo, 2016/11/01
- [Guile-commits] 14/17: Remove last critical section use,
Andy Wingo <=
- [Guile-commits] 17/17: Deprecate critical sections, Andy Wingo, 2016/11/01