RFR (XS) 8213383 : Wrap up pthread_cond_wait into a loop to workaround potential spurious wakeups

dean.long at oracle.com dean.long at oracle.com
Tue Nov 6 00:09:08 UTC 2018


Looks good, but do you want to use a while loop instead of if-do-while?

     if (tid != pthread_self()) {
       while (jvm_signal_installing) {
         pthread_cond_wait(&cond, &mutex);
       }
     }


dl

On 11/5/18 11:59 AM, Ivan Gerasimov wrote:
> Hello!
>
> In src/java.base/unix/native/libjsig/jsig.c:
>
> signal_lock() makes all the thread that are not jvm wait while the 
> later is installing signal handlers.
> This is done via a call to pthread_cond_wait().
> Spurious wakeups from pthread_cond_wait() are allowed, so it needs to 
> be wrapped up into a loop.
>
> Would you please help review the trivial fix?
> Control build and testing of tier1,2,3 went fine on all supported 
> platforms.
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8213383
> WEBREV: http://cr.openjdk.java.net/~igerasim/8213383/00/webrev/
>
> Thanks!
>



More information about the hotspot-runtime-dev mailing list