mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
in null threads, don't define sigmask stub when pthread_sigmask does not exist
* libguile/gen-scmconfig.c (main) [HAVE_PTHREAD_SIGMASK]: new output define SCM_HAVE_PTHREAD_SIGMASK * libguile/null-threads.h (scm_i_pthread_sigmask) [SCM_HAVE_PTHREAD_SIGMASK]: make inline function conditional on existence of pthread_sigmask
This commit is contained in:
parent
d3f7a1d0b7
commit
449b9bd5e1
2 changed files with 12 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2003-2013,2018
|
/* Copyright 2003-2013,2018,2020
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -289,6 +289,12 @@ main (int argc, char *argv[])
|
||||||
pf ("#define SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER %d /* 0 or 1 */\n",
|
pf ("#define SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER %d /* 0 or 1 */\n",
|
||||||
SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER);
|
SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER);
|
||||||
|
|
||||||
|
#ifdef HAVE_PTHREAD_SIGMASK
|
||||||
|
pf ("#define SCM_HAVE_PTHREAD_SIGMASK 1 /* 0 or 1 */\n");
|
||||||
|
#else
|
||||||
|
pf ("#define SCM_HAVE_PTHREAD_SIGMASK 0 /* 0 or 1 */\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GC_PTHREAD_CANCEL
|
#ifdef HAVE_GC_PTHREAD_CANCEL
|
||||||
pf ("#define SCM_HAVE_GC_PTHREAD_CANCEL 1 /* 0 or 1 */\n");
|
pf ("#define SCM_HAVE_GC_PTHREAD_CANCEL 1 /* 0 or 1 */\n");
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef SCM_NULL_THREADS_H
|
#ifndef SCM_NULL_THREADS_H
|
||||||
#define SCM_NULL_THREADS_H
|
#define SCM_NULL_THREADS_H
|
||||||
|
|
||||||
/* Copyright 2005-2006,2010,2018
|
/* Copyright 2005-2006,2010,2018,2020
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -83,11 +83,13 @@ scm_i_sched_yield (void)
|
||||||
|
|
||||||
/* Signals
|
/* Signals
|
||||||
*/
|
*/
|
||||||
|
#if SCM_HAVE_PTHREAD_SIGMASK == 1
|
||||||
static inline int
|
static inline int
|
||||||
scm_i_pthread_sigmask (int how, const sigset_t *set, sigset_t *oldset)
|
scm_i_pthread_sigmask (int how, const sigset_t *set, sigset_t *oldset)
|
||||||
{
|
{
|
||||||
return sigprocmask (how, set, oldset);
|
return sigprocmask (how, set, oldset);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Mutexes
|
/* Mutexes
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue