8141529-NSIG-hs-rt Udiff src/os/bsd/vm/jsig.c (original) (raw)

< prev index next >

Print this page

rev 9384 : 8141529: Fix handling of _JAVA_SR_SIGNUM


@@ -34,16 +34,18 @@ #include <dlfcn.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> +#include <stdint.h> -#define MAXSIGNUM 32 -#define MASK(sig) ((unsigned int)1 << sig)

-static struct sigaction sact[MAXSIGNUM]; /* saved signal handlers / -static unsigned int jvmsigs = 0; / signals used by jvm / +#define MASK(sig) ((uint32_t)1 << (sig-1)) // 0 is not a signal. +#if (32 < NSIG-1) +#error "Not all signals can be encoded in jvmsigs. Adapt its type!" +#endif +static struct sigaction sact[NSIG]; / saved signal handlers / +static uint32_t jvmsigs = 0; / signals used by jvm / static __thread bool reentry = false; / prevent reentry deadlock (per-thread) */

/* used to synchronize the installation of signal handlers */ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;

< prev index next >