ibmruntimes / openj9-openjdk-jdk

Extensions for OpenJDK for Eclipse OpenJ9
GNU General Public License v2.0
17 stars 73 forks source link

Add synchronization when setting interrupted field in Thread::interrupt #812

Closed ThanHenderson closed 2 months ago

ThanHenderson commented 2 months ago

This patch fixes https://github.com/eclipse-openj9/openj9/issues/19304. Setting the interrupted field to true and calling interrupt0 in Thread::interrupt used to be synchronized via interruptLock. An OpenJDK change removed this synchronization which caused a data race on the interrupted field with ReentrantLockTest leading to intermittent test failures.

This patch adds the synchronized block around setting interrupted and calling interrupt0 and eliminates the data race with ReentrantLockTest.

Issues: https://github.com/eclipse-openj9/openj9/issues/19304 Signed-off-by: Nathan Henderson nathan.henderson@ibm.com

ThanHenderson commented 2 months ago

@babsingh Could you review/start PR builds?

babsingh commented 2 months ago

jenkins test sanity,sanity.openjdk alinux64 jdknext