[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: threadlib and emacs
From: |
Bruno Haible |
Subject: |
Re: threadlib and emacs |
Date: |
Sat, 9 Jul 2011 12:16:51 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Paul,
> I was asked to stop installing this sort of change into Emacs
> for now, as it's in feature freeze. At some point we'll reopen
> the Emacs trunk for general changes and then we can revisit
> this issue. Or, we can revisit the issue if there's
> an actual bug.
But in the meantime, m4/pthread_sigmask.m4 is broken in gnulib.
My tests bypassed the bug, because I was using
$ ./gnulib-tool -create-testdir --with-tests --single-configure ...
which happened to include the 'threadlib' module. But it is
nevertheless present.
I see that you have installed an Emacs specific version in Emacs [1].
This is good: It allows the Emacs specific version to obey the Emacs specific
constraints, without constraining gnulib.
[1]
http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/m4/pthread_sigmask.m4
So, I would like to apply this sooner than later:
2011-07-09 Bruno Haible <address@hidden>
pthread_sigmask: Rely on module 'threadlib'.
* modules/pthread_sigmask (Depends-on): Add threadlib.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Assume gl_THREADLIB
is defined.
*** m4/pthread_sigmask.m4.orig Sat Jul 9 12:09:53 2011
--- m4/pthread_sigmask.m4 Sat Jul 9 12:06:34 2011
***************
*** 1,4 ****
! # pthread_sigmask.m4 serial 9
dnl Copyright (C) 2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # pthread_sigmask.m4 serial 10
dnl Copyright (C) 2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
***************
*** 6,75 ****
AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
[
AC_CHECK_FUNCS_ONCE([pthread_sigmask])
LIB_PTHREAD_SIGMASK=
! m4_ifdef([gl_THREADLIB], [
! AC_REQUIRE([gl_THREADLIB])
! if test "$gl_threads_api" = posix; then
! if test $ac_cv_func_pthread_sigmask = yes; then
! dnl pthread_sigmask is available without -lpthread.
! :
! else
! if test -n "$LIBMULTITHREAD"; then
! AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
! [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
! [gl_save_LIBS="$LIBS"
! LIBS="$LIBS $LIBMULTITHREAD"
! AC_LINK_IFELSE(
! [AC_LANG_PROGRAM(
! [[#include <pthread.h>
! #include <signal.h>
! ]],
! [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *)
0);]])
! ],
! [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
! [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
! LIBS="$gl_save_LIBS"
! ])
! if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
! dnl pthread_sigmask is available with -lpthread.
! LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
! else
! dnl pthread_sigmask is not available at all.
! HAVE_PTHREAD_SIGMASK=0
! fi
else
dnl pthread_sigmask is not available at all.
HAVE_PTHREAD_SIGMASK=0
fi
- fi
- else
- dnl pthread_sigmask may exist but does not interoperate with the chosen
- dnl multithreading facility.
- dnl If "$gl_threads_api" = pth, we could use the function pth_sigmask,
- dnl but it is equivalent to sigprocmask, so we choose to emulate
- dnl pthread_sigmask with sigprocmask also in this case. This yields
fewer
- dnl link dependencies.
- if test $ac_cv_func_pthread_sigmask = yes; then
- REPLACE_PTHREAD_SIGMASK=1
else
HAVE_PTHREAD_SIGMASK=0
fi
fi
! ] ,[
! dnl gl_THREADLIB is not in use. Assume the application wants
! dnl POSIX semantics.
! if test $ac_cv_func_pthread_sigmask != yes; then
! gl_save_LIBS=$LIBS
! AC_SEARCH_LIBS([pthread_sigmask], [pthread c_r])
! LIBS=$gl_save_LIBS
! if test "$ac_cv_search_pthread_sigmask" = no; then
! HAVE_PTHREAD_SIGMASK=0
! elif test "$ac_cv_search_pthread_sigmask" != 'none required'; then
! LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask
! fi
fi
! ])
AC_SUBST([LIB_PTHREAD_SIGMASK])
dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
--- 6,61 ----
AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
[
+ AC_REQUIRE([gl_THREADLIB])
+
AC_CHECK_FUNCS_ONCE([pthread_sigmask])
LIB_PTHREAD_SIGMASK=
! if test "$gl_threads_api" = posix; then
! if test $ac_cv_func_pthread_sigmask = yes; then
! dnl pthread_sigmask is available without -lpthread.
! :
! else
! if test -n "$LIBMULTITHREAD"; then
! AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
! [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
! [gl_save_LIBS="$LIBS"
! LIBS="$LIBS $LIBMULTITHREAD"
! AC_LINK_IFELSE(
! [AC_LANG_PROGRAM(
! [[#include <pthread.h>
! #include <signal.h>
! ]],
! [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *)
0);]])
! ],
! [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
! [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
! LIBS="$gl_save_LIBS"
! ])
! if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
! dnl pthread_sigmask is available with -lpthread.
! LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
else
dnl pthread_sigmask is not available at all.
HAVE_PTHREAD_SIGMASK=0
fi
else
+ dnl pthread_sigmask is not available at all.
HAVE_PTHREAD_SIGMASK=0
fi
fi
! else
! dnl pthread_sigmask may exist but does not interoperate with the chosen
! dnl multithreading facility.
! dnl If "$gl_threads_api" = pth, we could use the function pth_sigmask,
! dnl but it is equivalent to sigprocmask, so we choose to emulate
! dnl pthread_sigmask with sigprocmask also in this case. This yields fewer
! dnl link dependencies.
! if test $ac_cv_func_pthread_sigmask = yes; then
! REPLACE_PTHREAD_SIGMASK=1
! else
! HAVE_PTHREAD_SIGMASK=0
fi
! fi
AC_SUBST([LIB_PTHREAD_SIGMASK])
dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
*** modules/pthread_sigmask.orig Sat Jul 9 12:09:53 2011
--- modules/pthread_sigmask Sat Jul 9 12:05:15 2011
***************
*** 7,12 ****
--- 7,13 ----
Depends-on:
signal
+ threadlib
sigprocmask [test $HAVE_PTHREAD_SIGMASK = 0 || test
$REPLACE_PTHREAD_SIGMASK = 1]
configure.ac:
--
In memoriam Báb <http://en.wikipedia.org/wiki/Báb>
- [PATCH 03/10] pthread_sigmask: new module, Paul Eggert, 2011/07/06
- [PATCH] pthread_sigmask: always replace when not using pthread, Eric Blake, 2011/07/06
- unit tests for sigprocmask, Bruno Haible, 2011/07/07
- Re: [PATCH 03/10] pthread_sigmask: new module, Bruno Haible, 2011/07/07
- Re: [PATCH 03/10] pthread_sigmask: new module, Paul Eggert, 2011/07/08
- Re: [PATCH 03/10] pthread_sigmask: new module, Bruno Haible, 2011/07/08
- Re: [PATCH 03/10] pthread_sigmask: new module, Paul Eggert, 2011/07/08
- Re: threadlib and emacs, Bruno Haible, 2011/07/08
- Re: threadlib and emacs, Paul Eggert, 2011/07/09
- Re: threadlib and emacs,
Bruno Haible <=
- Re: threadlib and emacs, Paul Eggert, 2011/07/09
- Re: threadlib and emacs, Bruno Haible, 2011/07/12
- Re: threadlib and emacs, Paul Eggert, 2011/07/16
- Re: threadlib and emacs, Bruno Haible, 2011/07/17
- Re: threadlib and emacs, Paul Eggert, 2011/07/17
- Re: threadlib and emacs, Paul Eggert, 2011/07/17
- Re: threadlib and emacs, Bruno Haible, 2011/07/18
- Re: threadlib and emacs, Paul Eggert, 2011/07/19
- Re: threadlib and emacs, Bruno Haible, 2011/07/19
- Re: threadlib and emacs, Paul Eggert, 2011/07/25