[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 07/07: ltdl wrappers now use a recursive mutex.
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 07/07: ltdl wrappers now use a recursive mutex. |
Date: |
Wed, 22 Nov 2017 10:47:18 -0500 (EST) |
civodul pushed a commit to branch stable-2.2
in repository guile.
commit 48d42553ef5a9c2240bc2296d1b38dbfd5fca1ac
Author: Ludovic Courtès <address@hidden>
Date: Wed Nov 22 16:46:11 2017 +0100
ltdl wrappers now use a recursive mutex.
Fixes <https://bugs.gnu.org/29275>.
Reported by noxdafox <address@hidden>.
* libguile/dynl.c (scm_init_dynamic_linking): Add call to
'scm_i_pthread_mutex_init'.
---
libguile/dynl.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/libguile/dynl.c b/libguile/dynl.c
index b9497b1..2a25e5d 100644
--- a/libguile/dynl.c
+++ b/libguile/dynl.c
@@ -1,7 +1,7 @@
/* dynl.c - dynamic linking
*
* Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
- * 2003, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ * 2003, 2008, 2009, 2010, 2011, 2017 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -66,10 +66,9 @@ maybe_drag_in_eprintf ()
#include <ltdl.h>
-/*
- From the libtool manual: "Note that libltdl is not threadsafe,
- i.e. a multithreaded application has to use a mutex for libltdl.".
-*/
+/* From the libtool manual: "Note that libltdl is not threadsafe,
+ i.e. a multithreaded application has to use a mutex for libltdl.".
+ Note: We initialize it as a recursive mutex below. */
static scm_i_pthread_mutex_t ltdl_lock = SCM_I_PTHREAD_MUTEX_INITIALIZER;
/* LT_PATH_SEP-separated extension library search path, searched last */
@@ -401,6 +400,13 @@ scm_init_dynamic_linking ()
{
scm_tc16_dynamic_obj = scm_make_smob_type ("dynamic-object", 0);
scm_set_smob_print (scm_tc16_dynamic_obj, dynl_obj_print);
+
+ /* Make LTDL_LOCK recursive so that a pre-unwind handler can still use
+ 'dynamic-link', as is the case at the REPL. See
+ <https://bugs.gnu.org/29275>. */
+ scm_i_pthread_mutex_init (<dl_lock,
+ scm_i_pthread_mutexattr_recursive);
+
sysdep_dynl_init ();
#include "libguile/dynl.x"
}
- [Guile-commits] branch stable-2.2 updated (2fe9a85 -> 48d4255), Ludovic Courtès, 2017/11/22
- [Guile-commits] 02/07: Convert `close' ref to xref., Ludovic Courtès, 2017/11/22
- [Guile-commits] 01/07: Honor '%fresh-auto-compile'., Ludovic Courtès, 2017/11/22
- [Guile-commits] 04/07: ia64: Fix crash in thread context switch., Ludovic Courtès, 2017/11/22
- [Guile-commits] 06/07: foreign: Add 'uintptr_t' and 'intptr_t'., Ludovic Courtès, 2017/11/22
- [Guile-commits] 05/07: scripts: help: Fix reference to the "Using Guile Tools" node., Ludovic Courtès, 2017/11/22
- [Guile-commits] 03/07: Mention (ice-9 peg) module path., Ludovic Courtès, 2017/11/22
- [Guile-commits] 07/07: ltdl wrappers now use a recursive mutex.,
Ludovic Courtès <=