# HG changeset patch # User mgronlun # Date 1360751026 -3600 # Node ID 5bd5dc5b9bb9b2206240f7dbc4953dffd843db7c # Parent d069aaa14d4c4307d7cde0d4a1f819fc871df6a9 8007312: null check signal semaphore in os::signal_notify windows Reviewed-by: dholmes, sla diff -r d069aaa14d4c -r 5bd5dc5b9bb9 hotspot/src/os/windows/vm/os_windows.cpp --- a/hotspot/src/os/windows/vm/os_windows.cpp Tue Feb 12 12:19:28 2013 -0500 +++ b/hotspot/src/os/windows/vm/os_windows.cpp Wed Feb 13 11:23:46 2013 +0100 @@ -1940,7 +1940,7 @@ // a counter for each possible signal value, including signal_thread exit signal static volatile jint pending_signals[NSIG+1] = { 0 }; -static HANDLE sig_sem; +static HANDLE sig_sem = NULL; void os::signal_init_pd() { // Initialize signal structures @@ -1970,10 +1970,11 @@ void os::signal_notify(int signal_number) { BOOL ret; - - Atomic::inc(&pending_signals[signal_number]); - ret = ::ReleaseSemaphore(sig_sem, 1, NULL); - assert(ret != 0, "ReleaseSemaphore() failed"); + if (sig_sem != NULL) { + Atomic::inc(&pending_signals[signal_number]); + ret = ::ReleaseSemaphore(sig_sem, 1, NULL); + assert(ret != 0, "ReleaseSemaphore() failed"); + } } static int check_pending_signals(bool wait_for_signal) {