fix build failures with --disable-threads

This commit is contained in:
Marius Gerbershagen 2018-03-02 18:56:23 +01:00
parent d87c5b2c5a
commit eca39581a5
2 changed files with 16 additions and 16 deletions

View file

@ -28,7 +28,7 @@
#else
# define AO_load(x) (x)
# define AO_store(x,y) ((x)=(y))
# define AO_nop_full(x,y)
# define AO_nop_full()
#endif
#endif /* ECL_ATOMIC_OPS_H */

View file

@ -23,21 +23,21 @@
* via mprotect(), so we have to use sigprocmask instead. No
* performance problems, since this is only used for stack
* resizing. */
#ifdef ECL_USE_MPROTECT
#ifdef HAVE_SIGPROCMASK
#include <signal.h>
#define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) \
sigset_t __sigset_new, __sigset_previous; \
sigfillset(&__sigset_new); \
pthread_sigmask(SIG_BLOCK, &__sigset_new, &__sigset_previous)
#define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) \
pthread_sigmask(SIG_SETMASK, &__sigset_previous, NULL)
#if defined(ECL_THREADS) && defined(ECL_USE_MPROTECT)
# ifdef HAVE_SIGPROCMASK
# include <signal.h>
# define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) \
sigset_t __sigset_new, __sigset_previous; \
sigfillset(&__sigset_new); \
pthread_sigmask(SIG_BLOCK, &__sigset_new, &__sigset_previous)
# define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) \
pthread_sigmask(SIG_SETMASK, &__sigset_previous, NULL)
# else
# error "Can't protect stack resizing from interrupts without sigprocmask. Either build ECL without mprotect() or live with possible race conditions."
# endif /* HAVE_SIGPROCMASK */
#else
#error "Can't protect stack resizing from interrupts without sigprocmask. Either build ECL without mprotect() or live with possible race conditions."
#endif /* HAVE_SIGPROCMASK */
#else
#define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) ecl_disable_interrupts_env(the_env);
#define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) ecl_enable_interrupts_env(env);
#endif /* ECL_USE_MPROTECT */
# define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) ecl_disable_interrupts_env(the_env);
# define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) ecl_enable_interrupts_env(env);
# endif /* ECL_THREADS && ECL_USE_MPROTECT */
#endif /* ECL_STACK_RESIZE_H */