Mercurial > hg > graal-jvmci-8
changeset 23173:777a354cada5 jdk8u66-b01
Merge
author | asaha |
---|---|
date | Wed, 15 Jul 2015 12:03:54 -0700 |
parents | aed0c05a7505 (diff) 6b4ea38c01bd (current diff) |
children | 6051e1f96a8d |
files | .hgtags |
diffstat | 3 files changed, 35 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed Jul 15 11:48:08 2015 -0700 +++ b/.hgtags Wed Jul 15 12:03:54 2015 -0700 @@ -681,3 +681,4 @@ 0e4094950cd312c8f95c7f37336606323fe049fe jdk8u60-b23 d89ceecf1bad55e1aee2932b8895d60fc64c15db hs25.60-b23 fb157d537278cda4150740e27bb57cd8694e15bf jdk8u60-b24 +878cb0df27c22c6b1e9f4add1eb3da3edc8ab51d jdk8u66-b00
--- a/make/hotspot_version Wed Jul 15 11:48:08 2015 -0700 +++ b/make/hotspot_version Wed Jul 15 12:03:54 2015 -0700 @@ -34,8 +34,8 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2015 HS_MAJOR_VER=25 -HS_MINOR_VER=60 -HS_BUILD_NUMBER=23 +HS_MINOR_VER=66 +HS_BUILD_NUMBER=01 JDK_MAJOR_VER=1 JDK_MINOR_VER=8
--- a/src/os/bsd/vm/jsig.c Wed Jul 15 11:48:08 2015 -0700 +++ b/src/os/bsd/vm/jsig.c Wed Jul 15 12:03:54 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> +#include <string.h> #define MAXSIGNUM 32 #define MASK(sig) ((unsigned int)1 << sig) @@ -43,6 +44,9 @@ static struct sigaction sact[MAXSIGNUM]; /* saved signal handlers */ static unsigned int jvmsigs = 0; /* signals used by jvm */ +static pthread_key_t reentry_flag_key; +static pthread_once_t reentry_key_init_once = PTHREAD_ONCE_INIT; + /* used to synchronize the installation of signal handlers */ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; @@ -59,6 +63,15 @@ static bool jvm_signal_installing = false; static bool jvm_signal_installed = false; +#define check_status(cmd) \ + do { \ + int status = (cmd); \ + if (status != 0) { \ + printf("error %s (%d) in " #cmd "\n", strerror(status), status); \ + exit(1); \ + } \ + } while (0) + static void signal_lock() { pthread_mutex_lock(&mutex); /* When the jvm is installing its set of signal handlers, threads @@ -74,8 +87,15 @@ pthread_mutex_unlock(&mutex); } +static void reentry_tls_init() { + // value for reentry_flag_key will default to NULL (false) + check_status(pthread_key_create(&reentry_flag_key, NULL)); +} + static sa_handler_t call_os_signal(int sig, sa_handler_t disp, bool is_sigset) { + sa_handler_t res; + if (os_signal == NULL) { if (!is_sigset) { os_signal = (signal_t)dlsym(RTLD_NEXT, "signal"); @@ -87,7 +107,12 @@ exit(0); } } - return (*os_signal)(sig, disp); + check_status(pthread_once(&reentry_key_init_once, reentry_tls_init)); + // set reentry_flag_key to non-NULL to show reentry + check_status(pthread_setspecific(reentry_flag_key, &res)); + res = (*os_signal)(sig, disp); + check_status(pthread_setspecific(reentry_flag_key, NULL)); + return res; } static void save_signal_handler(int sig, sa_handler_t disp) { @@ -161,6 +186,11 @@ bool sigused; struct sigaction oldAct; + check_status(pthread_once(&reentry_key_init_once, reentry_tls_init)); + if (pthread_getspecific(reentry_flag_key) != NULL) { + return call_os_sigaction(sig, act, oact); + } + signal_lock(); sigused = (MASK(sig) & jvmsigs) != 0;